Example: |
|
| <table border=2 cellpadding=4> </table> |
| |
|
Cellspacing
The cellspacing attribute sets the amount of space between the cells of a table. If the borders are visible cellspacing controls the width of internal borders.
Example: |
|
| <table border=3 cellspacing=3> </table> |
|
|
Width
The width attribute sets the width of the table. It can be expressed either as an absolute value in pixels, or as a percentage of screen width.
Example: |
|
<table border=2 width=70%> </table> |
| |
Bgcolor
The Bgcolor attribute sets the background color of the entire table.
Example: |
|
<table border=1 bgcolor=yellow> </table> |
| |
Background
The background attribute sets the background image for the table.
Example: |
|
<table border=1 background=”myimage.gif”> </table> |
| |
Align
The align attribute sets the position of the table in relation to the page. It takes the value- left or right.
Example: |
|
<table border=2 align=left> </table> |
| |
Hspace and Vspace
Hspace and Vspace indicate the amount of horizontal and vertical space to be put between the able and surrounding text. They must be used in conjunction with the <align> tag.
Example: |
|
<table align=left hspace=10 vspace=20> </table> |
| |
Bordercolor
The bordercolor attribute sets the color of all the borders of the table.
Example: |
|
<table border=5 bordercolor=red> </table> |
| |
TR Tag
The <tr> tag designates a table row. Each <tr> tag contains one or more <td> i.e. table data or <th> i.e. table header elements.
Example: |
<table border=2> |
| <tr> <td>cricket jokes</td> <td> tennis jokes</td> <td>golf jokes</td> </tr> |
| <tr> <td>classic jokes</td> <td>soft jokes</td> <td>political jokes</td> </tr> |
| </table> |
| |
|
Attributes of TR Tag
Halign
Halign sets the horizontal alignment of cells in the row. It takes up the values left, center and right.
Example: |
| <tr halign=left> <td>common jokes</td> </tr> |
| |
|
Valign
Valign sets the vertical alignment of the row. It can be set to top, middle, bottom or baseline.
Example: |
| <tr valign=top> <td>common jokes </td> </tr> |
| |
|
Bgcolor
Bgcolor sets the background color for the table row.
Example: |
<tr bgcolor=”#CCCC99”> <td> common jokes </td> </tr> |
|
|
Bordercolor
Bordercolor works similarly as with the <table> tag. The basic difference is that it only sets the colors of the inside borders.
Example: |
|
<tr bordercolor=red> <td> common jokes </td> </tr> |
| |
|