|
|
home
/ reference
/ html
<table></table>

border
cellspacing
cellpadding
width
height
align
valign
bgcolor
bordercolor
bordercolorlight
bordercolordark
background
frame
rules
A table is used to align data into rows and columns. Within each <table> tag there should be
a <tr> tag for each row you would like to create. Then, within the <tr> tags, there should be a <td> tag
for each column you would like to create in each row. (See <tr> and <td>.)
<table border="">
| |
Description
| |
The border attribute is used to create a border around each cell in the table.
The number value inserted will determine the thickness of the border, with 1 being the
smallest.
|
Code
| |
<table border="2"></table>
|
|
<table cellspacing="">
| |
Description
| |
The cellspacing attribute determines the amount of space between the table data cells.
The default value is 2
|
Code
| |
<table cellspacing="5"></table>
|
|
<table cellpadding="">
| |
Description
| |
The cellpadding attribute is used to define the amount of space between the borders
of a data cell and where the actual cell data begins. The default value is 1.
|
Code
| |
<table cellpadding="2"></table>
|
|
<table width="">
| |
Description
| |
The width attribute is used to define the exact width of the table, either as a pixel value
or as a percentage of the browser display window.
|
Code
| |
<table width="20"></table>
|
|
<table height="">
| |
Description
| |
The height attribute is used to define the exact height of the table, either as a pixel value
or as a percentage of the browser display window.
|
Code
| |
<table height="20"></table>
|
|
<table align="">
| |
Description
| |
The align attribute is used to define the alignment of the table on the screen.
Acceptable value are left and right. Leaving this attribute out will default the alignment to "center."
|
Code
| |
<table align="left"></table>
|
|
<table valign="">
| |
Description
| |
The valign attribute allows you to specify the vertical alignment of text within the entire table.
Acceptable values are top and bottom.
|
Code
| |
<table valign="bottom"></table>
|
|
<table bgcolor="">
| |
Description
| |
The bgcolor attribute allows you to set the background color of the table, either by using
a hex value or a color name. Acceptable color names are the same as for the <font> tag.
(See <font>)
|
Code
| |
<table bgcolor="red"></table>
|
|
<table bordercolor="">
| |
Description
| |
The bordercolor attribute defines the border color of the table as either a hex value or by using the color name.
Acceptable values are the same as for the <font> tag. (See <font>.)
|
Code
| |
<table bordercolor="red"></tr>
|
|
<table bordercolorlight="">
| |
Description
| |
The bordercolorlight attribute allows you to set the lighter color of a 3-D border for a table as either a hex value or by using a color name.
It is the oppposite of the bordercolordark attribute.
Acceptable values are the same as for the <font> tag. (See <font>.) |
Code
| |
<table bordercolorlight="red"></tr>
|
|
<table bordercolordark="">
| |
Description
| |
The bordercolordark attribute allows you to set the darker color of a 3-D border for a table as either a hex value or by using a color name.
It is the oppposite of the bordercolorlight attribute.
Acceptable values are the same as for the <font> tag. (See <font>.)
|
Code
| |
<table bordercolordark="red"></tr>
|
|
<table background="">
| |
Description
| |
The background attribute allows you to specify a background image for a table. Type the url
or file path of the image between the quotes.
|
Code
| |
<table background="FILENAME.jpg"></table>
|
|
<table frame="">
| |
Description
| |
The frame attribute affects the display of table borders and
therefore requires that the table border attribute be set. Possible values are:
- void - Removes all external borders
- above - Displays a border at the top of the table
- below - Displays a border at the bottom of the table
- besides - Displays an external top and bottom border
- lhs - Displays an external left hand border
- rhs - Displays an external right hand border
- vsides - Displays external left and right hand borders
- box - Displays a box around the table
|
Code
| |
<table border="2" frame="void"></table>
|
|
<table rules="">
| |
Description
| |
The rules tag affects internal table borders and will only be effective after the border, <thead>, <tbody>, and <tfoot> sections have been set.
It can accept the following values:
- none - Removes all internal rules
- basic - Displays horizontal borders between the <thead>, <tfoot>, and <tbody>
- rows - Displays horizontal borders between all rows
- columns - Displays horizontal borders between all columns
- all - Displays all internal rules
(See table border, <tfoot>, <thead>, and <tbody>.)
|
Code
| |
<table rules="2"></table>
|
|
|