Site hosted by Angelfire.com: Build your free website today!
 

colspan tutorial

tables part 4 tutorial about 'colspan' with examples

on this page we look at colspan
on the previous page we made this html table
my first table
my first table


lets add another cell to the bottom row
<TABLE border="1"> <TR> <TD>my first table</TD> </TR> <TR> <TD>my first table</TD> <TD>my first table</TD> </TR> </TABLE>

the code above gives us this
my first table
my first table my first table


now we have a problem, a 'ghost cell'
we can deal with the ghost cell using the colspan attribute
lets add colspan=2 to the table definition in the top row
<TABLE border="1"> <TR> <TD colspan="2">my first table</TD> </TR> <TR> <TD>my first table</TD> <TD>my first table</TD> </TR> </TABLE>

the code above gives us this
my first table
my first table my first table

in the table below the second row has four cells, so colspan is set to 4 in the table definition in the first row
<TD colspan=4>
my first table
my first table my first table my first table my first table


on the next page we will talk about rowspan

html tutorial    html tutorial    html tables tutorial    next :
previous :
rowspan
the tr tag

html tutorial css tutorial javascript webmaster articles link exchange

html tutorial

make money
from your website