How can I create these type of tables in html? The green one is the main header and there are some main header having subheaders. I have tried many solutions, but I can't figure out how it will work.
Asked
Active
Viewed 73 times
0
-
1You need to use rowspan and colspan – Sagar Kodte Feb 21 '18 at 07:34
-
1What have you tried so far to create such a table in html? – t.niese Feb 21 '18 at 07:34
-
Or [merge two html table cells](https://stackoverflow.com/questions/4342336/merge-two-html-table-cells) – t.niese Feb 21 '18 at 07:39
1 Answers
-1
Here is example of using rowspan and colspan.
<table border="1" cellspacing="0">
<thead>
<tr>
<th rowspan="2">header</th>
<th rowspan="2">header</th>
<th colspan="4">header</th>
<th rowspan="2">header</th>
</tr>
<tr>
<th>subheader</th>
<th>subheader</th>
</tr>
</thead>
Refer this for more information

Sagar Kodte
- 3,723
- 4
- 23
- 52