Table-header-group and table-footer-group in Div

Is there a way to use the table-header-group and table-footer-group in a div instead of aad or tfoot?

+3
html html-table
source share
2 answers

According to www.w3.org, it is allowed to use display: table-header-group when the parent element (the element containing the div) is displayed as a table or an embedded table. So something like this should be allowed

 <table> <div style="display: table-header-group;">header group</div> </table> 

If the parent is not a table, it must be inserted in accordance with paragraph 4 on the page www.w3.org .

The big problem is whether all (main) browsers support it. Especially IE (6) is known for not supporting most types of displays.

+5
source share

According to W3C, you cannot use an element as a direct child node inside a <table> . http://w3schools.com/html5/tag_table.asp . This article states that a <table> may contain:

  • tr
  • td
  • th
  • heading
  • color
  • Cologup
  • THEAD
  • TFOOT
  • TBODY

what you can do if you want to avoid using a table:

 <div style="display:table;"> <div style="display:table-header-group;">header group</div> </div> 

This solution, however, is only possible in HTML5.

+3
source share

All Articles