CoderTools Web site

HTML Table Column - The <td> Tag

Description


To define a column in a table you use the <td> tag.

The td tag for each column must be specified for each row in the table. The td tag only exists within the tr tag.

The td tag can have 3 formatting attributes specified in the Attributes table at the end of the page.

Example


For example:

        <table border="1">
            <tr>
                <td>row 1 column 1</td><td>row 1 colum 2</td>
            </tr>
            <tr>
                <td>row 2 column 1</td><td>row 2 colum 2</td>
            </tr>
        </table>Give it a go!
    

Attributes


Name Values Description
height number
% e.g. 50%
Specifies the height of the table.
width number
% e.g. 50%
Specifies the width of the table.
align left|center|right align the contents of the cells in the row to the left center or right of the table
valign top|middle|bottom|baseline specifies the vertical alignment of the cells content within the row.
bgcolor #rrggbb or color name specifies the background color of the row. This overrides the bgcolor of the table element.
background url A url of an image to use as the background. The image is tiled if it is smaller than the table.
bgcolor #rrggbb or color name specifies the background color of the table. This value can be overridden by the bgcolor of the table row <tr> element.
colspan number The number of columns this cell occupies.

See Colspan/Rowspan
rowspan number the number of rows this cell occupies.

See Colspan/Rowspan

8/19/2017 4:14:04 PM
Terms Of Use | Privacy Statement | Copyright 2006-2015 © Independence Software LLP