I am trying to create the following html table:
I can't work out why my current implementation is not yielding my desired result. As you can see in the snippet, the last <td> in the second <tr> spans 2 cols, and not the middle <td>.
table{
width: 100%;
}
table tr td {
background-color: #ddd;
}
table tr td[colspan="2"]{
background-color: #0a0;
}
table tr td[colspan="4"]{
font-size: 16px;
text-align:center;
background-color: #8C0000;
color: #fff;
}
<table>
<tbody>
<tr>
<td colspan="4"><b>Full width column</b></td>
</tr>
<tr>
<td>Column 1</td>
<td colspan="2">Column 2</td>
<td>Column 3</td>
</tr>
</tbody>
</table>
In researching I found the following from: https://www.w3.org/TR/WD-html40-970917/struct/tables.html
There are several ways to determine the number of columns:
Count the number of columns as specified by COL and COLGROUP elements which can only occur at the start of the table (after the optional CAPTION).
Scan each row in turn to compute the number of columns needed for each row, taking into account cells that span multiple rows and/or columns. Set the number of columns for the table to be the maximum number of columns from each row. For any row that has less than this number of columns, the end of that row should be padded with empty cells. The "end" of a row depends on the directionality of the table.
[deprecated] Use the cols attribute on the TABLE element. This is the weakest method since it doesn't provide any additional information about column widths. This may not matter, however, if the author uses style sheets to specify widths.
So what have I misunderstood about this functionality?
Please also note, that I am aware that I can use css to specifically set the widths of the <td>'s I want to know why my current implementation is not working.

colspanandwidth. Not all columns are the same width, socolspan=2does not make a column twice the width of any other column. If you add a 3rd row that has 4 cells, then thecolspan=2column would be the width of the middle 2 columns of the 3rd row.colspan2 != colspan1 * 2? Are you saying that colspan2 simply inhabits 2 columns of any size in the same place relative to the whole table? p.s. if that makes no sense I won't be surprised, I can try and re-word it - again - haha.