This tests the part of the HTML table algorithm that specifies the ordering of thead, tfoot, tbody, and plain tr elements in constructing a table.
The following table is constructed, based on caption, thead, tbody, tfoot, and tr children which appear in the source in the row described.
Each thead, tbody, and tfoot contains a single tr element
thead, tbody, and tfoot are coloured by CSS, just to show what matches each selector - which seems to work according to spec.
| F1 | First footer, first row of source |
|---|---|
| F2 | Second footer, second row of source |
| B1 | First tbody, third row of source |
| B2 | Second tbody, fourth row of source |
| H1 | First header, fifth row of source |
| H2 | Second header, sixth row of source |
| F3 | Third footer, seventh row of source |
| R1 | First direct tr child, eighth row of source |
| H2 | Third header, eleventh row of source |
| B3 | Third tbody, twelfth row of source |
| R2 | Second direct tr child, thirteenth row of source |
| B4 | Fourth tbody, fourteenth row of source |
| H4 | Fourth header, fifteenth row of source |
| F4 | Fourth footer, sixteenth row of source |
| R3 | Third direct tr child, seventeenth row of source |
This bit is broken in IE / Edge. Pull requests accepted
thead at the top of the table and return its tr child as table.rows[0]tfoot encountered at the end of the tablethead, tbody, tfoot, and direct tr children in the order they are encountered in the source.caption, tHead, and tFoot DOM attributes of the table match the first element of each type encountered in the source.caption elements are rendered, at the top of the tabletr children of thead elements to table.rows in the order they are encountered in the source, followed by all tr children of tbody elements or the table element itself, followed by all tr children of tfoot elements.caption elements are rendered, at the top of the tabletr children of only the first thead child at the start of table.rows, and the tr children of only the first tfoot child at the end of ittbody and direct tr children, and all tfoot and thead children other than the first of each enountered, to table.rows after the tr children of the first thead in the order they are encountered in the source.caption element encountered is rendered, at the top of the tabletr children of only the first thead child at the start of table.rows, and the tr children of only the first tfoot child at the end of ittbody and direct tr children, and all tfoot and thead children other than the first of each enountered, to table.rows after the tr children of the first thead in the order they are encountered in the source.