HTML Element Style How to - Add table cell TD rowspan








Question

We would like to know how to add table cell TD rowspan.

Answer


<!DOCTYPE html>
<html>
<head>
<style type='text/css'>
td {<!--   w ww  . j  a  va2  s.  c o  m-->
  border: solid black 1px;
}
</style>
</head>
<body>
  <table width="100%" border="0" cellspacing="0" cellpadding="0">
    <tr>
      <td rowspan="2">a</td>
      <td>b</td>
      <td rowspan="2">d</td>
    </tr>
    <tr>
      <td>c</td>
    </tr>
  </table>
</body>
</html>

The code above is rendered as follows: