English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
The rules attribute specifies which parts of the internal borders should be displayed. For practical reasons, it is best not to specify any rules and instead use CSS.
Only show the borders between rows:
<p>The table has rules="rows":</p> <table rules="rows"> <tr> <th>Grade</th> <th>Number of people</th> </tr> <tr> <td>Grade 3</td> <td>56</td> </tr> </table> <p>The table has rules="cols":</p> <table rules="cols"> <tr> <th>Grade</th> <th>Number of people</th> </tr> <tr> <td>Grade 3</td> <td>56</td> </tr> </table> <p>The table has rules="all":</p> <table rules="all"> <tr> <th>Grade</th> <th>Number of people</th> </tr> <tr> <td>Grade 3</td> <td>56</td> </tr> </table>Test and see ‹/›
IEFirefoxOperaChromeSafari
Internet Explorer 9+, Firefox, Opera, Chrome, and Safari support the rules attribute.
Note:Internet Explorer 8 and earlier versions do not support the rules attribute of the <table> tag.
Note:Chrome and Safari display the property incorrectly: in addition to the inner border, the affected outer border will also be added.
HTML5 The <table> rules attribute is not supported. Please use CSS instead.
The rules attribute specifies which part of the inner border is visible.
From a practical point of view, it is best not to specify rules, but to use CSS to add them borders (border style).
<table rules="value">
Value | Description |
---|---|
none | No lines. |
groups | Lines between row and column groups. |
rows | Lines between rows. |
cols | Lines between columns. |
all | Lines between rows and columns. |