English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
Die valign-Eigenschaft legt die vertikale Ausrichtung des Inhalts in Zellen fest, Online-Beispiel, um die Verwendung der HTML td valign-Eigenschaft, die Kompatibilität der Browser, die Syntaxdefinition und die detaillierten Informationen zu ihren Attributwerten zu demonstrieren.
In<td>Elemente den Inhalt vertikal ausrichten:
<table style="width:100%" border="1" height="400"> <tr> <th>Nr.</th> <th>Monat</th> <th>Ersparnis</th> </tr> <tr> <td valign="top">1</td> <td valign="top">Januar</td> <td valign="top">3100</td> </tr> <tr> <td valign="bottom">2</td> <td valign="bottom">Februar</td> <td valign="bottom">2180</td> </tr> </table>Testen Sie, ob ‹/›
IEFirefoxOperChromeSafari
All major browsers support the valign attribute.
HTML5 The <td> valign attribute is not supported. Please use CSS instead.
The valign attribute specifies the vertical alignment of the content within the cell.
<td valign="top|middle|bottom|baseline">
Value | Description |
---|---|
top | Align content to the top. |
middle | Align content to the center (default value). |
bottom | Align content to the bottom. |
baseline | Align content to the baseline. The baseline is a fictional line. In a line of text, most letters are based on the baseline. The baseline value sets all table data in the line to share the same baseline. The effect of this value is often the same as the bottom value. However, if the text sizes are different, the baseline effect is better. Please see the illustration below. |
When the text size is different, the bottom vs. baseline illustration:
valign="bottom"
valign="baseline"
HTML <td> Tag