1 | initial version |
To create a table with a fixed element and two headers, you can use HTML code with the following steps:
<table>
<tr>
<th colspan="2">Header 1</th>
</tr>
The colspan
attribute tells the browser that the header cell should span across two columns.
<tr>
<th>Fixed Element</th>
<th>Header 2</th>
</tr>
<tr>
<td>Row 1 Cell 1</td>
<td>Row 1 Cell 2</td>
</tr>
<tr>
<td>Row 2 Cell 1</td>
<td>Row 2 Cell 2</td>
</tr>
</table>
Here is the complete HTML code for a table with a fixed element and two headers:
<table>
<tr>
<th colspan="2">Header 1</th>
</tr>
<tr>
<th>Fixed Element</th>
<th>Header 2</th>
</tr>
<tr>
<td>Row 1 Cell 1</td>
<td>Row 1 Cell 2</td>
</tr>
<tr>
<td>Row 2 Cell 1</td>
<td>Row 2 Cell 2</td>
</tr>
</table>