Skip to main content

Table header issue showcase

The issue arises when setting a row cell as a header (with 'responsive table' style applied.) Below is a table with just the top row set as column headings:

Column head 1Column head 2
Row 1Data 1
Row 2Data 2
Row 3Data 3
Row 4Data 4

And here is the HTML:

<table cellpadding="1" cellspacing="0" border="1" width="70%">

<tbody><tr><th scope="col"><b>Column head 1</b></th>

<th scope="col">Column head 2</th>

</tr><tr><td><b>Row 1</b></td>

<td>Data 1</td>

</tr><tr><td><b>Row 1</b></td>

<td>Data 1</td>

</tr><tr><td><b>Row 1</b></td>

<td>Data 1</td>

</tr><tr><td><b>Row 1</b></td>

<td>Data 1</td>

</tr></tbody></table>

Now if I set Row 1, 2, 3 and 4 as headings:

Column head 1Column head 2
Data 1
Data 2
Data 3
Data 4

The header rows have completely disappeared. Here's the HTML:

<table cellpadding="1" cellspacing="0" border="1" width="70%">

<tbody><tr><th scope="col"><b>Column head 1</b></th>

<th scope="col">Column head 2</th>

</tr><tr><td>Data 1</td>

</tr><tr><td>Data 2</td>

</tr><tr><td>Data 3</td>

</tr><tr><td>Data 4</td>

</tr></tbody></table>

As you can see, the cells set as row headers have been removed entirely, meaning that the table will need to be reauthored.

This behaviour does not occur when the responsive table style is not selected:

 

Column head 1Column head 2
Row 1Data 1
Row 2Data 2
Row 3Data 3
Row 4Data 4

So I believe the issue is related to the responsive table style.