You are here: Reference > HTML > attributes > border (img, object, table, ...)

border attribute (img, object, table, ...)

Browser support:
Sets the thickness of the border.
This attribute is deprecated.
Use the border style property instead, or use the rules attribute to specify a border drawing formula (vertical only, horizontal only or both).
JavaScript page for this attribute: border. You can find other example(s) there.

Possible values:

String that sets the thickness of the border, with an integer optionally followed by a 'px' (pixel) unit designator.
Default: this attribute has no default value.

Example HTML code 1:

This example illustrates the use of the border attribute:
<table id="myTable" border="6px">
    <tr>
        <td>Apple</td>
        <td>Pear</td>
        <td>Peach</td>
    </tr>
</table>
Did you find this example helpful? yes no

Example HTML code 2:

Recommendation:
<head>
    <style>
        .myTable {
            border:6px solid;
            /* top right bottom left */
            border-color:#ece9d8 #aca988 #aca988 #ece9d8;
        }

        .myTable td {
            border:1px solid;
            /* top right bottom left */
            border-color:#aca988 #ece9d8 #ece9d8 #aca988;
        }
    </style>
</head>
<body>
    <table class="myTable">
        <tr>
            <td>Apple</td>
            <td>Pear</td>
            <td>Peach</td>
        </tr>
    </table>
</body>
Did you find this example helpful? yes no

Supported by tags:

Related pages:

External links:

User Contributed Comments

Post Content

Post Content