English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

HTML reference manual

HTML tag大全

HTML table frame attribute

The frame attribute specifies which parts of the external table border should be visible. It is better not to specify the frame but to use CSS to apply the border.

 HTML <table> tag

Online example

Only display the outer border of the table:

<p>The table has frame="box":</p>/p>
<table frame="box">
  <tr>
    <th>Name</th>/th>
    <th>Score</th>/th>
  </tr>
  <tr>
    <td>Wang Wu</td>/td>
    <td>96.5</td>
  </tr>
</table>
<p>The table has frame="above":</p>/p>
<table frame="above">
  <tr>
    <th>Name</th>/th>
    <th>Score</th>/th>
  </tr>
  <tr>
    <td>Wang Wu</td>/td>
    <td>96.5</td>
  </tr>
</table>
<p>The table has frame="below":</p>/p>
<table frame="below">
  <tr>
    <th>Name</th>/th>
    <th>Score</th>/th>
  </tr>
  <tr>
    <td>Wang Wu</td>/td>
    <td>96.5</td>
  </tr>
</table>
<p>The table has frame="hsides":</p>/p>
<table frame="hsides">
  <tr>
    <th>Name</th>/th>
    <th>Score</th>/th>
  </tr>
  <tr>
    <td>Wang Wu</td>/td>
    <td>96.5</td>
  </tr>
</table>
<p>The table has frame="vsides":</p>/p>
<table frame="vsides">
  <tr>
    <th>Name</th>/th>
    <th>Score</th>/th>
  </tr>
  <tr>
    <td>Wang Wu</td>/td>
    <td>96.5</td>
  </tr>
</table>
Test to see ‹/›

Browser compatibility

IEFirefoxOperaChromeSafari

Internet Explorer 9+Firefox, Opera, Chrome, and Safari support the frame attribute.

Note:Internet Explorer 8 and earlier versions do not support the frame attribute of the <table> tag.

Definition and Usage

HTML5 The <table> frame attribute is not supported. Please use CSS instead.

The frame attribute specifies which part of the outer table border is visible.

Tip:From a practical point of view, it is best not to specify frame and use CSS to add instead. borders (border style).

Syntax

<table frame="value">

Attribute value

ValueDescription
voidDo not display outer borders.
aboveDisplay the top outer border.
belowDisplay the bottom outer border.
hsidesDisplay the top and bottom outer borders.
vsidesDisplay both left and right outer borders.
lhsDisplay the left outer border.
rhsDisplay the right outer border.
boxDisplay outer borders on all four sides.
borderDisplay outer borders on all four sides.
 HTML <table> tag