Spanning columns : table colspan « Tags « HTML / CSS






Spanning columns

 

<?xml version="1.0" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">

<head>
  <title>Spanning columns</title>
</head>

<body>
<table border="1">
<caption>Spanning columns using the colspan attribute</caption>
  <tr>
    <td bgcolor="#efefef" width="100" height="100">&nbsp;</td>
    <td bgcolor="#999999" width="100" height="100">&nbsp;</td>
    <td bgcolor="#000000" width="100" height="100">&nbsp;</td>
  </tr>
  <tr>
    <td bgcolor="#efefef" width="100" height="100">&nbsp;</td>
    <td colspan="2" bgcolor="#999999">&nbsp;</td>
  </tr>
  <tr>
    <td colspan="3" bgcolor="#efefef" height="100">&nbsp;</td>
  </tr>
</table>
</body>
</html>

   
  








Related examples in the same category

1.'colspan' sets how many columns in a table a particular cell can span
2.Using colspan and rowspan