Attributes of <TABLE>
- ALIGN: Takes LEFT, RIGHT or CENTER as value and aligns the table with respect to surrounding information. If the table is aligned to the right, any text or information will be aligned to the left of the table.
- BACKGROUND: The value of this attribute has to be an image URL. This image is displayed as the background of the table. If the table is larger, the image is tiled.
- BGCOLOR: Specifies the background color, hexadecimal color codes or color names accepted.
- BORDER: We have already met this attribute in the previous section. It makes a border around the table. The thickness of this border depends on the number in pixels supplied as its value.
- BORDERCOLOR: Table borders can be colored using this attribute. It takes hexadecimal color code or color name as value.
- BORDERCOLORDARK and BORDERCOLORLIGHT: Works only with Internet Explorer. The default rendering of table borders is in 3D. If you don't want this, you can specify the same color in BORDERCOLORDARK and BORDERCOLORLIGHT attributes. For such cases, BORDERCOLOR attribute should also be used with that color value so that the table display looks similar in Netscape and Internet Explorer.
- CELLPADDING: Its value, supplied as number of pixels, denotes the amount of space between the edge of the table and its contents.
- CELLSPACING: This attribute sets the width in pixels between the individual table cells.
- FRAME: Its value determines the display of a frame around the table. The default value is BORDER or BOX which indicates that the table should have a frame (This works only when the BORDER attribute has a positive value). A value of ABOVE makes a frame only at the top of the table. BELOW makes only at the bottom. HSIDES and VSIDES make horizontal and vertical edges, respectively. RHS specifies only the right edge to be displayed and LHS only the left edges.
- HEIGHT: Specifies the table height. The value has to be in pixels. (Percentage values are supported by Internet Explorer only).
- WIDTH: determines the table width. Its value can be in pixels and results in a fixed table size or in percentages where the table width changes depending on the size of browser window.
Attributes of <TD> Tag
- ALIGN: Its value can be CENTER, LEFT, RIGHT or JUSTIFY, which determine how cell contents are aligned.
- VALIGN: Aligns the contents to the TOP, MIDDLE or BOTTOM of the cell.
- BGCOLOR: Specifies background color, hexadecimal color code or color name.
- BORDERCOLOR, BORDERCOLORDARK and BORDERCOLORLIGHT: Determines bordercolors; the last two are specific to Internet Explorer.
- COLSPAN and ROWSPAN: Value has to be a number. The attributes are explained along with examples in the following sections... hold on.
- HEIGHT and WIDTH: specify dimensions in pixels.
Attributes of <TR> Tag
- ALIGN: Its value can be CENTER, LEFT, RIGHT or JUSTIFY, which aligns the content.
- BGCOLOR: Similar to TD, above.
- BORDERCOLOR: Similar to TD, above.
- BORDERCOLORDARK and BORDERCOLORLIGHT: Similar to TD, above.
Labels: success, tables, web, web-design