Introduction
Text
Formatting
Links
Lists
Images
Tables
Introduction to Tables
Table Attributes
TR Attributes
TD Attributes
Example
Frames
Forms
Conclusion


Table Tag Attriubutes
Here we will discuss the attributes for the table tag. Some of these attributes may also be overridden when we define the row and columns of the table.

WIDTH
There are two types of entries you can make into this field: 1) a percentage; 2) a number representing the pixel size. For example you can make the table take up the entire page by setting the width to 100% and no matter what screen resolution the user views it in it will always take up the entire page.

<TABLE WIDTH="100%">

HEIGHT
The height attribute allows you to control the height of the table, but this attribute is not supported by most browsers. The main reason a person might use this attribute is to make the page take up the entire screen in which case you would set it to 100%. Make sure to test the page, since not all browsers support the table height attribute.

<TABLE WIDTH="100%" HEIGHT="10%">

BORDER
The border attribute defines the thickness of the border for every cell in the table. If you would like to not have a border just set the value to "0". The larger border gives the table a 3-dimentional effect.

<TABLE BORDER="3">

BORDERCOLOR
The bordercolor attribute allows you to set the color for the table border.

<TABLE BORDER="4" BORDERCOLOR="FF0000">

CELLPADDING AND CELLSPACING
The cellspacing attribute makes the border of the table thicker, giving the cells more space from each other. While the cellpadding attribute add space on the inside of each cell, giving the contents of the cell more space. If the table doesn't have a border it is harder to differentiate between these two attributes, but if you will have a border or add color to your table the difference will become apparent. See the example further in this section to show you how the difference will actually appear. The default setting for the both of these attributes is set to a value of "2", so make sure to set it to "0" if you do not want any spacing.

<TABLE CELLSPACING="3" CELLPADDING="3">

ALIGN
The align attribute allows you to align the table with the rest of the page. The value for this attribute is: right, left, and center. Left is the default setting.

<TABLE ALIGN="center">

back  next

© Copyright 2000-2002 by Pepmint.com. All Rights Reserved

Search Pepmint.com

home :: tutorial :: portfolio :: links :: hammies :: guestbook :: contact