HTML Cookbook

Recipes for tasty webpages from
html.help.gnubee

Home of the MALLRATS




Basic Table Layout


Here we show a 4x4 table layout so you can see the effects of colspan and rowspan.
The border & cellpadding are set to 1 so you see the individual cells.
Column 1 Column 2 Column 3 Column 4
Row 1
       
       
       
       
Row 2
Row 3
Row 4



Now we'll combine the top row cells into one big cell using <td colspan="4">. Since the first data cell takes up the whole row, we only need 1 <td> tag in the first row. Here's the code.

Column 1 Column 2 Column 3 Column 4
Row 1
colspan="4"
       
       
       
Row 2
Row 3
Row 4



Now we'll combine the first column cells into one big cell using <td rowspan="4">. Since the first data cell takes up a whole column, we only need 3 <td> tags in the 2nd, 3rd & 4th rows. Here's the code.

Column 1 Column 2 Column 3 Column 4
Row 1
rowspan="4"      
     
     
     
Row 2
Row 3
Row 4



Finally, we'll combine colspan & rowspan to build some colored blocks in our table. Here's the code.

Column 1 Column 2 Column 3 Column 4
Row 1
colspan="4"
rowspan="3"      
  colspan="2" &
rowspan="2"
 
Row 2
Row 3
Row 4

More on Colspan
More on Rowspan
Colspan & Rowspan Together

Back To Tables Intro
Back To Index
More Mallrats Tutorials