HTML Table Tag


HTML Table Tag

    The <table></table> tags are an extremely useful HTML tool. In essence, it can make a checker board pattern of many dimensions. Anything can go in any cell. This is a wonderful tool for page layouts.


Syntax


<TABLE width=xxx cellpadding=xx cellspacing=xx border=x bgcolor="#rrggbb" bordercolor="#rrggbb" align=position valign=position nowrap>


  <tr>
    <th>heading-text</th>
    <td>text-or-graphics</td>
  <tr>

</TABLE>

Modifiers

WIDTH=number
The width is the width of the table in either pixels or the percentage of the screen (ie; 80%).
ALIGN=position
The align modifier controls the location of an item that is shorter than the screen width. It can be LEFT, CENTER or RIGHT.
VALIGN=position
The valign modifier controls the vertical locations for the entire table.
BGCOLOR="color"
Defines the background color.
CELLPADDING=number
The cellpadding modifier separates the borders from the text by a number of pixels.
CELLSPACING=number
The cellspacing modifier separates each cell from another by number of pixels.
BORDERCOLOR="color"
The HTML table border color for the table.
NOWRAP
Do not wrap text without the <br> tag.

Tips

WIDTH problems
The width of each cell is determined by everything within the table. If you want precise widths, try using a transparent graphic of the precise width in each cell going across.
Tables are being replaced with CSS
You may also want to look into learning Cascading Style Sheets (CSS).