Tuesday, July 30, 2013

HTML Tables with a css chaser

The basic table

<style type="text/css">
/* This is a style sheet */
/* Comments */
/* the dot '.' at the start of a line declare a class name */
.class1
{
     background-color: #CCCCff;
     margin: 0px;
      padding: 0px;
}
</STYLE>
<TABLE border=0>
<TR>
<TD> Hello </TD>
<TD> This is column 2</TD>
<TD>This is column 3</TD>
</TR>
<TR BGCOLOR='BFBFFF'>

<TD> Note the </TD>
<TD>White space</TD>
<TD>between columns</TD>
</TR>
<TD class='class1' colspan='100%'>Spans the whole table</TD>
</TR>
<TR>
<TD STYLE='border-bottom: 1px solid #000000' >Hello again  </TD>
<TD STYLE='border-bottom: 1px solid #000000' >Note the white space</TD>
<TD STYLE='border-bottom: 1px solid #000000' >the line is not continuous</TD>
</TR>
</TABLE>



Hello This is column 2 This is column 3
Note the White space between columns
Spans the whole table
Hello again Note the white space the line is not continuous

To get rid of the space between the cells
<TABLE border=0 cellpadding=0 cellspacing=0>

Hello This is column 2 This is column 3
Note the White space between columns
Spans the whole table
Hello again Note the white space the line is now continuous







No comments:

Post a Comment