Ou Courses  Banner ADBH Web - HTML Help - Tables
ADBH Web 08-Aug-2008

HTML Help - Tables

Tables

Tables are one of the most useful tag items available to web designers. They are frequently used to format the appearance of a page - my main page uses tables to organise its content.

<table></table> Creates a table

<tr></tr> Defines a row in the table

<td></td> Defines each cell in each row

<table border=number> Sets borderthickness

<table cellspacing=number> Sets space between cells.

<table cellpadding=number> Sets space between the edge of a cell and the contents.

<table width=number or number%> Sets table width. Uses either pixels or percentage. - Percentage allows the table width to resize to fit the users screen settings. Pixel means the table is fixed and will not resize.

<tr align=number> Align the row contents left, right or center

<td align=number> Align the cells contents left, right or center

<tr valign=number> Sets the vertical alignment of the row uses top, middle or bottom.

<td valign=number> Sets the vertical alignment of the cell uses top, middle or bottom

<td colspan=number>Sets cell width in terms of columns.

<td rowspan=number> Sets cell height in terms of rows.

<td nowrap> Stops the contents of the cell wrapping

This example shows how these fit together:

<table width="80%" border="3" cellpadding="3" cellspacing="3" bordercolor="red" bgcolor="red">
              <tr>
                      <td>Some text</td>
                      <td align="center" valign="middle">Some text</td>
                      <td align="center" valign="bottom">Some text</td></tr>
            <tr>
                       <td><td align="center">Some text</div></td>
                      <td>Some text</td>
                      <td>Some text</td>
            </tr>
            <tr>
                      <td>Some text</td>
                      <td align="center" valign="middle">Some text</td>
                      <td><div align="right">Some text</div></td>
            </tr>
            <tr>
                      <td align="right" valign="top">Some text</td>
                      <td>Some text</td>
                      <td>Some text</td>
            </tr>
</table>

 

 

 

Top of Page

 

 

 

Page built in 0.0006 seconds