Merge two cells in an HTML table

I am creating a table in HTML and I would like my top cell to be two wide. Here is an example:

__________________________________________ | HEADER | | | ========================================== | || | | CONTENT || CONTENT | | || | ------------------------------------------ 

Is there any way to do this in HTML?

+57
html html-table
Dec 03 2018-10-12T00:
source share
3 answers

Set the colspan attribute to 2.

... but do not use tables for layout .

+106
Dec 03 2018-10-12T00:
source share
— -

Add the colspan attribute (abbreviation for "column range") to the upper cell ( <td> ) and set its value to 2. Your table should look like this:

 <table> <tr> <td colspan = "2"> <!-- Merged Columns --> </td> </tr> <tr> <td> <!-- Column 1 --> </td> <td> <!-- Column 2 --> </td> </tr> </table> 
+96
Dec 03 2018-10-12T00:
source share

use colspan for this

  <td colspan="3">PUR mix up column</td> 
+1
Jun 14 '14 at 6:00
source share