frame (HTML attribute)

Spec
Depr. Version
No HTML 2
Browser support (more…)
IE8+ FF1+ SA3.1+ OP9.2+ CH2+
Full Full Full Full Full

Syntax

frame=" { above | below | border | box | hsides | lhs | rhs | void | vsides } "

Description

The frame attribute allows you to set a border on given edges of a table, as Figure 1 shows, or to a combination of edges. For example, you can use it to set a border on just the right-hand side ("rhs"), or on just the horizontal edges of the table. As such, this attribute is slightly more powerful than the humble border. However, all of the effects that this attribute makes achievable can be achieved with CSS (using the border-top, border-bottom, border-left, and border-right properties)—and this would be the better option.

Figure 1. Comparison of different frame values (viewed in Firefox) A comparison of the different frame values (as applied to Firefox - the only browser that supports all possible values)

Example

The frame for this table is set to "hsides":

<table frame="hsides">
  <tr>
    <th>Account Type</th>
    <th>Interest Rate</th>
  </tr>
  <tr>
    <td>Smart</td>
    <td>From 2%</td>
  </tr>
  <tr>
    <td>Young Saver</td>
    <td>From 1.6%</td>
  </tr>
</table>

Value

The recognized attribute values are as shown in the syntax section.

Compatibility

Internet Explorer Firefox Safari Opera Chrome
5.5 6.0 7.0 8.0 1.0 1.5 2.0 3.0 3.5 1.3 2.0 3.1 4.0 9.2 9.5 10.0 2.0
Buggy Buggy Buggy Full Full Full Full Full Full None None Full Full Full Full Full Full

Most browsers tested do something with this attribute’s values (with the exception of Safari versions 1 and 2, which ignore them completely), but Internet Explorer 6 and 7 interprets frame very differently from the other browsers (fixed in IE8). Firefox, Opera, and Safari 3 all render the borders on the table’s edges only, while IE6 & 7 also render the borders on the cells within the table.

User-contributed notes

Related Products