html table multiple header rows

Solutions on MaxInterview for html table multiple header rows by the best coders in the world

showing results for - "html table multiple header rows"
Leonardo
02 Jun 2020
1This is how I would do it (working fiddle at http://jsfiddle.net/7pDqb/) Tested in Chrome.
2
3th, td { border: 1px solid black }
4<table>
5  <thead>
6    <tr>
7      <th colspan="2">Major 1</th>
8      <th colspan="2">Major 2</th>
9    </tr>
10    <tr>
11      <th>col1</th>
12      <th>col2</th>
13      <th>col3</th>
14      <th>col4</th>
15    </tr>
16  </thead>
17  <tbody>
18    <tr>
19      <td>data1</td>
20      <td>data2</td>
21      <td>data3</td>
22      <td>data4</td>
23    </tr>
24  </tbody>
25</table>