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

HTML Reference Manual

HTML Tag大全

HTML table rules attribute

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.

 HTML <table> etichetta

Online Example

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 ‹/›

Browser Compatibility

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.

Definizione e uso

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)

Sintassi

<table rules="value">

Valore dell'attributo

ValoreDescrizione
noneNessuna linea.
groupsLinee tra gruppi di righe e colonne.
rowsLinee tra righe.
colsLinee tra colonne.
allLinee tra righe e colonne.
 HTML <table> etichetta