is it semantic/acceptable to put paging (NEXT/LAST, etc) links in a <tfoot> of a statistical table element?

Viewed 1653

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?

2 Answers

In general I agree with the accepted answer, but there's one exception: If you are on a small screen device and use overflow-x: auto for horizontal scrolling of the table, then you may (or may not) want your prev/next actions to stay visible - independent of the horizontal scroll position of the table.

Related