A financial report table needs consistent labels, units, and totals. Use a footer row for a summary when readers should connect it with the table data. Before writing the code, picture the information as a small grid. Each label should help a reader understand the value next to it.
What You Need to Know
Totals should be mathematically accurate and clearly identified with a header cell. HTML only displays the values; it does not calculate them for you.
Example: See It in Action
Add this example to the appropriate part of a practice HTML page. Read each line before you open the page in your browser.
This is a short HTML fragment. To try it as a webpage, put it inside the body element of a complete HTML document.
<table>
<caption>Monthly club expenses</caption>
<thead>
<tr>
<th scope="col">Category</th>
<th scope="col">Cost</th>
</tr>
</thead>
<tbody>
<tr>
<th scope="row">Supplies</th>
<td>$70</td>
</tr>
</tbody>
<tfoot>
<tr>
<th scope="row">Total</th>
<td>$70</td>
</tr>
</tfoot>
</table>
Let’s Understand the Example
- Table represents information whose row and column relationships matter.
- Caption gives the whole data table a clear name.
- Scope explains which table row, column or group a th cell labels.
Look at a data cell and ask: “What row and column does this value belong to?” The header elements help answer that question, including for people who navigate the table with a screen reader.
What Should You See?
You should see a grid for “Monthly club expenses”, with headers such as “Category”, “Cost”, “Supplies”. The browser displays cells, but meaningful table markup also helps readers connect each cell to its labels.
Read the first data row aloud together with its column labels. If you cannot explain a value without pointing to its position on screen, strengthen the headers.
Try It Yourself
- Add a second expense and update the total manually.
- Save your changes, open or refresh the page, and compare the result with the original example.
- Tell a friend what your change did. If you are not sure, undo it, refresh the page, and compare.
Common Beginner Mistakes
- Displaying a total that does not match the listed expense rows.
- Do not replace actual header cells with bold ordinary cells. Header markup is part of the meaning, not just the appearance.
Key Takeaways
- A financial report table needs consistent labels, units, and totals.
- Table represents information whose row and column relationships matter.
- Totals should be mathematically accurate and clearly identified with a header cell. HTML only displays the values; it does not calculate them for you.