Click to return to the DHTML, HTML     
SUP Element | SUP Object     TBODY Element | TBODY Obj...     DHTML Objects    
Web Workshop  |  DHTML, HTML & CSS

TABLE Element | TABLE Object


Specifies that the contained content is organized into a table with rows and columns.

HTML Syntax

<TABLE
    ALIGN=CENTER | LEFT | RIGHT
    BACKGROUND=url
    BGCOLOR=color
    BORDER=n
    BORDERCOLOR=color
    BORDERCOLORDARK=color
    BORDERCOLORLIGHT=color
    CELLPADDING=n
    CELLSPACING=n
    CLASS=classname
    COLS=n
    DATAPAGESIZE=n
    DATASRC=#ID
    FRAME=ABOVE | BELOW | BORDER | BOX | INSIDES | LHS | RHS | 
        VOID | VSIDES
    HEIGHT=n
    ID=value
    LANG=language
    LANGUAGE=JAVASCRIPT | JSCRIPT | VBSCRIPT  | VBS 
    RULES=ALL | COLS | GROUPS | NONE | ROWS
    STYLE=css1-properties
    TITLE=text
    WIDTH=n
    event = script
>

Remarks

The following tags are valid within a table: CAPTION, COL, COLGROUP, TBODY, TD, TFOOT, TH, THEAD, and TR.

While a document loads, modifications to a table are restricted until the window.onload event occurs. Read-only access is allowed at any time.

The TABLE object model is read-only for databound tables. For example, script used to remove a table row works correctly on an unbound table, but not on a databound table. The properties of a table object are still available, but changes to the bound data in a table must be made to the data source.

The properties of a table are distinct from the properties of cells contained within the table. For example, the offsetLeft property of a multicolumn table is not the same as the offsetLeft property of the left-most cell in the table. Refer to the appropriate object when writing scripts involving table and/or cell objects.

The TABLE element is a block element and requires a closing tag.

This element is available in HTML as of Microsoft® Internet Explorer 3.0, and in script as of Internet Explorer 4.0.

Members

Styles

Example

This example uses the TABLE element with THEAD, TR, and TH to create a table with three rows and two columns.

<TABLE BORDER=1 WIDTH=80%>
<THEAD>
<TR>
<TH>Heading 1</TH>
<TH>Heading 2</TH>
</TR>
</THEAD>
<TBODY>
<TR>
<TD>Row 1, Column 1 text.</TD>
<TD>Row 1, Column 2 text.</TD>
</TR>
<TR>
<TD>Row 2, Column 1 text.</TD>
<TD>Row 2, Column 2 text.</TD>
</TR>
</TBODY>
</TABLE>


Back to topBack to top

Did you find this topic useful? Suggestions for other topics? Write us!

© 1999 Microsoft Corporation. All rights reserved. Terms of use.