Spanning Multiple Rows and Cells - HTML CSS HTML

HTML CSS examples for HTML:Table

Description

Spanning Multiple Rows and Cells

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html lang="en">
 <head>
  <title>Example of HTML Table Rowspan and Colspan</title>
 </head><!--from w  w  w .j  a v  a 2  s.c o m-->
 <body>
  <h2>Example of Table Rowspan</h2>
  <table border="1" cellpadding="10">
   <tbody>
    <tr>
     <th rowspan="4">Users Info</th>
    </tr>
    <tr>
     <td>1</td>
     <td>Tom</td>
     <td>c@mail.com</td>
    </tr>
    <tr>
     <td>2</td>
     <td>Edith</td>
     <td>b@mail.com</td>
    </tr>
    <tr>
     <td>3</td>
     <td>Mary</td>
     <td>a@mail.com</td>
    </tr>
   </tbody>
  </table>
  <h2>Example of Table Colspan</h2>
  <table border="1" cellpadding="10">
   <tbody>
    <tr>
     <th colspan="3">Users Info</th>
    </tr>
    <tr>
     <td>1</td>
     <td>Tom</td>
     <td>c@mail.com</td>
    </tr>
    <tr>
     <td>2</td>
     <td>Edith</td>
     <td>b@mail.com</td>
    </tr>
    <tr>
     <td>3</td>
     <td>Mary</td>
     <td>a@mail.com</td>
    </tr>
   </tbody>
  </table>
 </body>
</html>

Related Tutorials