English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
Dieser Artikel beschreibt, wie man mit dem HTML-Attribut colgroup align die horizontale Ausrichtung des Inhalts in der Spaltengruppe legt. In HTML5 In HTML, the align attribute of <colgroup> is not supported.
Zwei <colgroup>-Elemente, die für drei Spalten in der Tabelle verschiedene Ausrichtungsarten angeben (Beachten Sie, dass das erste <colgroup>-Element zwei Spalten überspannt):
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>HTML <colgroup> char Attribut verwenden-Grund教程(oldtoolbag.com)</title> <style>table, th, td { border: 1px festes schwarzes Gestrick;}</style> </head> <body> <table style="width:100%"> <colgroup align="left"></colgroup> <colgroup align="char" char="."></colgroup> <tr> <th>Monat</st> <th>Ersparnisse</st> </tr> <tr> <td>Januar</td> <td>$100,00</td> </tr> <tr> <td>Februar</td> <td>$10.00</td> </tr> </table> </body> </html>Test it out ‹/›
IEFirefoxOperaChromeSafari
Only Opera and Internet Explorer 8 and earlier versions (IE 9 Not supported) supports the align attribute (IE 9 Not supported).
In HTML5 In HTML, the align attribute of <colgroup> is not supported.
The align attribute specifies the horizontal alignment of the content within the column group.
<colgroup align="left|right|center|justify|char">
Value | Description |
---|---|
left | Left-align content (the default value). |
right | Right-align content. |
center | Center-align content (the default value for the th element). |
justify | Stretch the line so that each line can have an equal width (as in newspapers and magazines). |
char | Align content to a specified character. |