HTML <tr> κείμενο
Definition and Usage
<tr>
tags define rows in HTML tables.
<tr>
Element contains one or more <th> or <td> Element.
See also:
HTML Tutorial:HTML πίνακας
HTML DOM Reference Manual:TableRow Object
CSS Tutorial:Set table styles
Example
Example 1
A simple three-row HTML table; one header row and two data rows:
<table> <tr> <th>month</th> <th>savings</th> </tr> <tr> <td>January</td> <td>¥3400</td> </tr> <tr> <td>February</td> <td>¥4500</td> </tr> </table>
Example 2
How to align: <tr>
content (using CSS):
<table style="width:100%"> <tr> <th>month</th> <th>savings</th> </tr> <tr style="text-align:right"> <td>January</td> <td>¥3400</td> </tr> </table>
Example 3
How to add background color to a table row (using CSS):
<table> <tr style="background-color:#FF0000"> <th>month</th> <th>savings</th> </tr> <tr> <td>January</td> <td>¥3400</td> </tr> </table>
Example 4
How to vertically align: <tr>
content (using CSS):
<table style="height:200px"> <tr style="vertical-align:top"> <th>month</th> <th>savings</th> </tr> <tr style="vertical-align:bottom"> <td>January</td> <td>¥3400</td> </tr> </table>
Example 5
How to create a table title:
<table> <tr> <th>name</th> <th>email</th> <th>phone</th> </tr> <tr> <td>Bill Gates</td> <td>bill.gates@example.com</td> <td>138-1234-5678</td> </tr> </table>
Example 6
How to create a table with a title:
<table> <caption>monthly savings</caption> <tr> <th>month</th> <th>savings</th> </tr> <tr> <td>January</td> <td>¥3400</td> </tr> <tr> <td>February</td> <td>¥4500</td> </tr> </table>
Example 7
How to define a table cell spanning multiple rows or columns:
<table> <tr> <th>name</th> <th>email</th> <th colspan="2">Τηλέφωνο</th> </tr> <tr> <td>Bill Gates</td> <td>bill.gates@example.com</td> <td>138-1234-5678</td> <td>186-2345-6789</td> </tr> </table>
Γενικές ιδιότητες
<tr>
Η ετικέτα υποστηρίζει επίσης Γενικές ιδιότητες στο HTML.
ιδιότητες συμβάντων
<tr>
Η ετικέτα υποστηρίζει επίσης Προσαρμοστικές ιδιότητες συμβάντων στο HTML.
Προεπιλεγμένες ρυθμίσεις CSS
Οι περισσότεροι περιηγητές θα χρησιμοποιήσουν τις παρακάτω προεπιλεγμένες τιμές για την εμφάνιση <tr>
Στοιχείο:
tr { display: table-row; vertical-align: inherit; border-color: inherit; }
Υποστήριξη περιηγητών
Chrome | Edge | Firefox | Safari | Opera |
---|---|---|---|---|
Chrome | Edge | Firefox | Safari | Opera |
Υποστήριξη | Υποστήριξη | Υποστήριξη | Υποστήριξη | Υποστήριξη |