English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
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.
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 ‹/›
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.
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).
<table frame="value">
Value | Description |
---|---|
void | Do not display outer borders. |
above | Display the top outer border. |
below | Display the bottom outer border. |
hsides | Display the top and bottom outer borders. |
vsides | Display both left and right outer borders. |
lhs | Display the left outer border. |
rhs | Display the right outer border. |
box | Display outer borders on all four sides. |
border | Display outer borders on all four sides. |