Can I have one HTML table header be over two table columns? Like merge and center in Excel?

Lizza picture Lizza · Jan 25, 2012 · Viewed 54.2k times · Source

I want to have one table header be centered over two table columns side by side. Is this possible?

Answer

SpoonNZ picture SpoonNZ · Jan 25, 2012

<th colspan="2">. This .</th>

To extrapolate a bit...

<table>
  <thead>
    <tr>
      <th>Single Column</th>
      <th colspan="2">Double Column</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>Column One</td>
      <td>Column Two</td>
      <td>Column Three</td>
    </tr>
  </tbody>
</table>

That should give you enough to work from.