Table: Column Span

To make a cell span more than one column, use the colspan attribute with the number of columns to span:

<th colspan="2">
HTML file: Displayed by browser:
<h3>Telephone Spans 2 Columns</h3>
<table>
  <tr>
    <th>Name</th>
    <th colspan="2">Telephone</th>
  </tr>
  <tr>
    <td>Bill Gates</td>
    <td>555 77 854</td>
    <td>555 77 855</td>
  </tr>
</table>

Telephone Spans 2 Columns

Name: Telephone:
Bill Gates 555 77 854 555 77 855

I tried doing this as a CSS styling (style="colspan:2px;"), but it doesn't work.

Back button Table of Contents Next button