Table header inside another
I want to omit the title element to include other subtitle elements:
<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> perhaps?
+4
1 answer
If you need a table inside a table, you need to use the <table> element again. You cannot just place another thead inside thead . You also lack the <tr> tags, and if you want the table inside the table to be used incorrectly with rowspan and colspan .
Option 1: you can use 2 lines in 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> +6