Tables


This is the basic code for tables:

The code row 1 column 1 is a comment. This is for your benefit only, tells you which cell is which.


To add more rows and columns the code would look like this:
This code produces a
table with 2 rows and 2 columns.



The number value specified by the BORDER tag lets you change the size of the border around the cells. You may turn the border off by placing a zero (0) as the value.



This table
has a border
value of 6
This table
has a border
value of 0


You may color the border by adding the BORDERCOLOR=" " tag. Make the interior cells larger by adding the CELLPADDING=" "





See the
pretty border?
Now see the
pretty borders.



A number value specified by Cellspacing tells the table cells how many pixels should be between each cell. (EX: CELLSPACING=15 the cells will be spaced 15 pixels apart).



This is a
table of nine
cells 3 across 3 down
This table's cells
are spaced by
10 pixels !




Use a percentage with the WIDTH tag to tell your table how much space to use on the page (note: if you do not specify a width the table will size itself according to how much data is within the table. (EX: WIDTH="50%", the width of the table will take up half the page.



This table will only take up 60% of the width of your page. This is helpful for blocks of text. Think of it as margins for your text. Look at a printed page in a book, the text does not start at the far left and does not end at the far right. There are margins on either side making it easier to read. Your pages will appear professionally designed. Little tricks such as this make a huge difference in the appearance of your website. Your visitors are more likely to read everything on your site if you make it easy for them.




Add the Center code to center a table:

To center the Data in the individual cells, add this code:


The data in these
cells are not centered
The data in these
cells are centered





Tables within tables. Instead of adding data in a cell add another table. The configurations are infinite.

This is a basic table with 1 row and 2 columns.
This is a basic 1 row 2 columns table.
This is another table in column 2
with 2 rows and 1 column.


Back