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 display 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 to see ‹/›
IEFirefoxOperaChromeSafari
Internet Explorer 9+, Firefox, Opera, Chrome e Safari supportano l'attributo rules.
Attenzione:Internet Explorer 8 e precedenti versioni non supportano l'attributo rules dell'etichetta <table>. Utilizzare CSS invece.
Attenzione:Chrome e Safari mostrano questa proprietà in modo non corretto: oltre al bordo interno, aggiungono anche il bordo esterno interessato.
HTML5 non supporta l'attributo rules di <table>. Utilizzare CSS invece.
L'attributo rules specifica quale parte dell'interno del bordo è visibile.
Per motivi pratici, è meglio non specificare rules, ma utilizzare CSS per aggiungere borders (stili di bordo)。
<table rules="value">
Valore | Descrizione |
---|---|
none | Nessuna linea. |
groups | Linee tra gruppi di righe e colonne. |
rows | Linee tra righe. |
cols | Linee tra colonne. |
all | Linee tra righe e colonne. |