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

HTML Referenzhandbuch

HTML-Tag-Übersicht

HTML: <colgroup> align Attribut

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.

 HTML <colgroup> Tag

Online-Beispiel

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 ‹/›

Browser Compatibility

IEFirefoxOperaChromeSafari

Only Opera and Internet Explorer 8 and earlier versions (IE 9 Not supported) supports the align attribute (IE 9 Not supported).

Definition and Usage

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.

Syntax

<colgroup align="left|right|center|justify|char">

Attribute Value

ValueDescription
leftLeft-align content (the default value).
rightRight-align content.
centerCenter-align content (the default value for the th element).
justifyStretch the line so that each line can have an equal width (as in newspapers and magazines).
charAlign content to a specified character.
 HTML <colgroup> Tag