Il tag HTML <tr>


Descrizione

Il tag HTML <tr> viene utilizzato per creare una riga all' interno di una tabella.

Esempio

<!DOCTYPE html>
<html>
<head>
<title>HTML tr Tag</title>
</head>
<body>
<table border="1">
  <tr>
    <th>Cricketers</th>
    <th>Ranking</th>
  </tr>
  <tr>
    <td>M.S Dhoni</td>
    <td>1</td>
  </tr>
  <tr>
    <td>Yuvraj Singh</td>
    <td>2</td>
  </tr>
  <tr>
    <td>Virat Kohli</td>
    <td>3</td>
  </tr>
</table>
</body>
</html>

Produrrà il seguente risultato:

Cricketers Ranking
M.S Dhoni 1
Yuvraj Singh 2
Virat Kohli 3

Attributi Globali

Questo tag supporta tutti gli attributi globali descritti in - HTML - Referenze Attributi

Attributi Specifici

Il tag HTML <tr> supporta anche i seguenti attributi aggiuntivi:

AttributoValoreDescrizione
alignright
left
center
justify
char
Deprecato-Allineamento orizzontale.
bgcolorrgb(x,x,x)
#hexcode
colorname
Deprecato-Specifica il colore della cella.
charcharacterDeprecato-Specifica a quale carattere allineare il testo, utilizzato quando vi è l' attributo align="char".
charoffpixels o %Deprecato-Specifica l'offset di allineamento (in pixels o percentuale) rispetto al primo carattere specificato. Utilizzato quando vi è l' attributo align="char".
valigntop
middle
bottom
baseline
Deprecato-Allineamento verticale.

Attributi Evento

Questo tag supporta tutti gli attributi evento descritti in - HTML - Referenze Eventi

Compatibilità Browser

ChromeFirefoxIEOperaSafariAndroid
SiSiSiSiSiSi
html_tags_reference.htm
Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements