having trouble deciding whether or not it makes sense to put paging information about a stats table in a <tfoot> element of the table.
information like "Page 1 of 13" and links to "next" & "prev," etc.
w3c <table> reference & examples don't do <tfoot> justice, IMO.
so, doing something like:
<table>
<caption>Stats Table!</caption>
<thead>
<tr>
<th>1</th>
<th>2</th>
<th>3</th>
</tr>
</thead>
<tfoot>
<tr>
<td colspan="3">
<a href="">prev pg</a> <a href="">next pg</a>
</td>
</tr>
</tfoot>
<tbody>
<tr>
<td>a</td>
<td>b</td>
<td>c</td>
</tr>
<tr>
<td>x</td>
<td>y</td>
<td>z</td>
</tr>
</tbody>
with some minor styling looks like this (click for example on jsfiddle)
does this seem to fit into proper semantics of html tables? any references as to why or why not?
I would say yes, that would be acceptable.
Traditionally, the <tfoot>
is usually used to duplicate header information when a table must be broken across boundaries (think printed pages and things of that nature). It also can be used as a static footer when the <tbody>
elements are rendered in a scrolling panel. I believe that is close enough to what you're trying to do.
As a side note, I'm glad to see you've placed the <tfoot>
before the <tbody>
. I can't begin to count how many times I see people put it at the bottom.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With