i want to span a heading element to include another sub headings elements like that:
<thead>
<th rowspan="2">main heading1</th>
<th rowspan="2">main heading2</th>
<th colspan="3">main heading3
<thead>
<tr>
<th>sub heading1</th>
<th>sub heading2</th>
<th>sub heading3</th>
<tr>
<thead>
</th>
<th rowspan="2">main heading4</th>
</thead>
is that possible ?
Learn HTML To create table header in HTML, use the <th>… </th> tag. A table header tag is surrounded by the table row <tr>… </tr>.
If you want a table inside a table, you need to use the <table> element again. You can't just place another thead inside the thead . You're also missing <tr> tags and if you want a table inside a table using rowspan and colspan incorrectly. Option 1: You could use 2 rows in your thead .
To apply the header row formatting to multiple rows in the table: after the table style is applied, select the rows you want included in the "header row" and on the Table tools > Layout tab, click Repeat Header Rows. If header row is ticked in Design tab > Table style options, you will see your header row formatting.
If you want a table inside a table, you need to use the <table>
element again. You can't just place another thead
inside the thead
. You're also missing <tr>
tags and if you want a table inside a table using rowspan
and colspan
incorrectly.
Option 1: You could use 2 rows in your thead
.
<thead>
<tr>
<th rowspan="2">main heading1</th>
<th rowspan="2">main heading2</th>
<th colspan="3">main heading3</th>
<th rowspan="2">main heading4</th>
</tr>
<tr>
<th>sub heading1</th>
<th>sub heading2</th>
<th>sub heading3</th>
</tr>
</thead>
Option 2: A table inside a table.
<thead>
<tr>
<th>main heading1</th>
<th>main heading2</th>
<th>main heading3
<table>
<thead>
<tr>
<th>sub heading1</th>
<th>sub heading2</th>
<th>sub heading3</th>
<tr>
<thead>
</table>
</th>
<th>main heading4</th>
</tr>
</thead>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With