HTML Basix - HTML tutorials and online webmaster tools




Htaccess code generators Code generators Tutorials

Online and offline code generators


Subscribe to RSS feed
Subscribe to the HTML Basix RSS feed.


HTMLBasix fully recommends Hostmonster as your host of choice.
Masses of space, transfer, great uptime. All for a VERY affordable price!
Borders  width  cellpadding  background images  rowspan 
alignment  height  cellspacing  background colour  colspan 


Table Attributes


There are various attributes you can use in your tables which will change the way they are displayed. By doing this, you can display your tables/data exactly how you want it displayed on your page.

You can use all of the attributes in the one tag, for example:

<table cellpadding="0" cellspacing="0" border="1" bordercolor="red" align="right" valign="bottom">

Borders

<table border="2" bordercolor="#008080">
<tr>
<td>
setting the width of the border and bordercolour
</td>
</tr>
</table>
setting the width of the border
and bordercolour

<table border="6" bordercolor="#008080">
<tr>
<td>
border width set to 6
</td>
</tr>
</table>
border width set to 6

<table border="0">
<tr>
<td>
border set to zero, no need for bordercolour!
</td>
</tr>
</table>
border set to zero, no need for bordercolour!


Cellpadding and Cellspacing

  • Cellpadding is the distance between the edge of the table data cell and the data within it. It's the 'padding' of the cell.
  • Cellspacing is the distance between the cells themselves.

<table border="2" bordercolor="#008080"cellpadding="0" cellspacing="0">
<tr>
<td>
If you don't set the cellpadding and cellspacing, it naturally uses a 1px space. To gain greater control, set them.
</td>
</tr>
</table>
If you don't set the cellpadding and cellspacing, it naturally uses a 1px space. To gain greater control, set them.

<table border="2" bordercolor="#008080"cellpadding="10" cellspacing="0">
<tr>
<td>
cellpadding set to 10
</td>
</tr>
</table>
cellpadding set to 10

<table border="2" bordercolor="#008080"cellpadding="0" cellspacing="10">
<tr>
<td>
cellspacing set to 10
</td>
</tr>
</table>
cellspacing set to 10

<table border="2" bordercolor="#008080"cellpadding="10" cellspacing="10">
<tr>
<td>
cellspacing and cellspacing set to 10
</td>
</tr>
</table>
cellspacing and cellspacing set to 10




Site Stats     
VisitorsPageviews
Total: 7,393,879 Total: 19,609,899
Today: 946 Today: 2,002
Yesterday: 1,607 Yesterday: 3,397
Past Month: 49,817 Past Month: 105,307

1,522 visitors in the last 24 hours
This page has been visited 22,649 times
There are currently 6 visitors online
click to see where
most people online at once:
120 visitors on 12/06/2010
   You beaut











This site is © HTML Basix 2003 - 2009