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

HTML Reference Manual

HTML Tag Comprehensive

HTML td height attribute

The td height attribute specifies the height of the cell. Usually, the cell occupies the space required for its display content. The height attribute is used to set the predefined height of the cell.

 HTML <td> etichetta

Online Example

Two table cells with predefined heights:

<table border="1">
  <tr>
      <th>Programming Language Books</th>
      <th>Price</th>
  </tr>
    <tr>
      <td height="80">PHP Basic Tutorial</td>
      <td height="80">$50</td>
    </tr>
    <tr>
      <td>Java Programming Thoughts</td>
      <td>$80</td>
    </tr>
</table>
Test to see ‹/›

Browser compatibility

IEFirefoxOperaChromeSafari

Tutti i browser mainstream supportano l'attributo height.

Definizione e uso

HTML5 non supporta l'attributo height di <td>. Usa CSS invece.

In HTML 4.01, l'attributo height di <td> è obsoleto.

 L'attributo height specifica l'altezza della cella.

Di solito, le celle occupano lo spazio necessario per il loro contenuto visibile. L'attributo height viene utilizzato per impostare l'altezza predefinita della cella.

Commenti di compatibilità

In HTML 4.01, l'attributo height di <td> è obsoleto. Usa CSS invece.

Sintassi CSS: <td style="height:100px">

Esempio CSS: Imposta l'altezza della cella della tabella

Nel nostro tutorial CSS, puoi trovare ulteriori informazioni su Attributo height dettagli.

Sintassi

<td height="pixels|%">

Valore dell'attributo

ValoreDescrizione
pixelsImposta un valore di altezza in pixel (ad esempio height="50").
%Imposta un valore di altezza percentuale per l'elemento (ad esempio height="50%").
 HTML <td> etichetta