htmlhtml-table

HTML: can a column span across both header and body rows?


I've got a table set up like this:

enter image description here

The first row is a header row, so it's inserted into the <thead> region of the HTML. The other rows are body rows, so they go into the <tbody> region.

Cell 1:1 has <td rowspan="4">

<table>
	<thead>
<tr>
		<td rowspan="4" >
		<p class="body" >Spanned column</p>
		</td>
		<td >
		<p class="body" >Header cell</p>
		</td>
		<td>
		<p class="body" >Header cell</p>
		</td>
		<td>
		<p class="body" >Header cell</p>
		</td>
	</tr></thead>
	<tbody>
	
	<tr>
		<td >
		<p class="body" >Body</p>
		</td>
		<td >
		<p class="body" >Body</p>
		</td>
		<td >
		<p class="body" >Body</p>
		</td>
	</tr>
	<tr>
		<td >
		<p class="body" >Body</p>
		</td>
		<td >
		<p class="body" >Body</p>
		</td>
		<td >
		<p class="body" >Body</p>
		</td>
	</tr>
	<tr>
		<td >
		<p class="body" >Body</p>
		</td>
		<td >
		<p class="body" >Body</p>
		</td>
		<td >
		<p class="body" >Body</p>
		</td>
	</tr>
	</tbody>
	</table>

My editing application allows me to create a column span that contains both heading and body rows, but the export to HTML does not look like the image above: in Antennahouse, the spanned column is treated as not spanned so its contents are placed in cell 1:1, which leaves the body cells shifted one column to the left.

enter image description here

Firefox also makes a mess.

Is this construction, i.e. a cell that is part of <thead> extending into rows that are part of <tbody>, legal? I can't find anything in the spec.


Solution

  • I found it in the specification after all:

    A cell cannot cover slots that are from two or more row groups.

    So the construction made by my export is illegal.