What do you use tables for? For organizing the page and performing what is called "layout". Layout is when you arrange the text, pictures and other objects into specific areas of the page. Tables help you with this arranging.

A table consists of a declaration of the table itself, one or more rows, and cell definitions. You build a table row by row, one cell at a time. Below is an example of basic HTML code for a table that is two rows by two columns:

<TABLE BORDER=1>
   <TR>
      <TD>Column 1</TD><TD>Column 2</TD>
   </TR>
   <TR>
      <TD>Column 1</TD><TD>Column 2</TD>
   </TR>
</TABLE>

The code above produces the following table:

Column 1 Column 2
Column 1 Column 2

TABLE ATTRIBUTES

Here is an example of a table showing most of the available attributes that tables can use (keep in mind I will only show you the things that are supported in most browsers). The code in bold lettering can be added to the table to modify how it looks. As always, cut, paste and experiment with the code below. That's the best way to learn.

<TABLE ALIGN="left|center|right"
       BGCOLOR="#rrggbb|color_name"
BACKGROUND="./path_to_file/filename.jpg" BORDER=2 CELLPADDING=2 CELLSPACING=2> <TR align=center valign=middle> <TD align=center valign=bottom> Column 1</TD><TD>Column 2</TD> </TR> <TR> <TD>Column 1</TD><TD>Column 2</TD> </TR> </TABLE>



Bookmark this page and SHARE:  

Search

Donations

Free Training