Is it semantic / acceptable for swap links (NEXT / LAST, etc.) in the <tfoot> of a table's statistical element?

there were problems with solving the question of whether it makes sense to put paging information about the statistics table in the <tfoot> element of the table.

information like "Page 1 of 13" and links to "next" and "previous", etc.

w3c <table> link , and examples are not executed <tfoot> justice, IMO.

so we’ll do 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 a little style looks like this (e.g. on jsfiddle)

does this seem to fit into the correct semantics of html tables? any links as to why or why not?

+6
source share
1 answer

I would say yes, that would be acceptable.

Traditionally, <tfoot> commonly used to duplicate header information when a table needs to be <tfoot> (think of printed pages and things of this nature). It can also be used as a static footer when <tbody> elements are displayed in the scroll bar. I believe this is close enough to what you are trying to do.

As a side note, I'm glad to see that you placed <tfoot> before <tbody> . I can’t start counting how many times I see people put it below.

+3
source

Source: https://habr.com/ru/post/892260/


All Articles