How can I style a table in html so it gets laid out like this:
<- full page width ->
<-20px->< dynamic ><-20px->< dynamic >
+------------------+-------------------+
¦ A ¦ B ¦ header row 1
+-------+----------+-------+-----------+
+ A1 ¦ A2 ¦ B1 ¦ B2 ¦ header row 2
+-------+----------+-------+-----------+
¦ a1 a2 b1 b2 ¦ data rows
Without the grouping header row, I would do it like this:
<table style="width:100%; table-layout:fixed;">
<tr>
<th style="width:20px;">A1</th>
<th style=" ">A2</th>
<th style="width:20px;">B1</th>
<th style=" ">B2</th>
</tr>
<tr>
<td>a1</td>
<td>a2</td>
<td>b1</td>
<td>b2</td>
</tr>
</table>
This works nicely, when I resize the browser window, the two cols without explicit width take the available space, while the two fixed cols stay at the given width.
But when I add the grouping header row, I have not found any way to assign widths so that the table has two fixed and two adaptable columns.