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

HTML Referenzhandbuch

HTML-Tag-Übersicht

HTML: <colgroup> valign Attribut

In HTML5 Nicht unterstützt <colgroup> valign Attribut. Das valign-Attribut legt die vertikale Ausrichtung des Inhalts in der Spaltengruppe fest.

 HTML <colgroup> Tag

Online-Beispiel

Eine HTML-Tabelle mit Spalten mit verschiedenen vertikalen Ausrichtungsarten:

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>HTML <colgroup> span Attribut verwenden-Grundlagen教程(oldtoolbag.com)</title>
<style>table, th, td { border: 1px solid black;}</style>
</head>
<body>
<table style="height:200px">
  <colgroup valign="top">
  <colgroup valign="bottom">
  <tr>
    <th>Monat</th>
    <th>Ersparnisse</th>
  </tr>
  <tr>
    <td>January</td>
    <td>$100</td>
  </tr>
</table>
</body>
</html>
Testen Sie es heraus ‹/›

Browserkompatibilität

IEFirefoxOperaChromeSafari

Nur Internet Explorer und Opera unterstützen das valign-Attribut. Allerdings unterstützen IE und Opera den Attributwert "baseline" nicht.

Definition and Usage

In HTML5 In HTML, the valign attribute of <colgroup> is not supported.

The valign attribute specifies the vertical alignment of the content within the column group.

Syntax

<colgroup valign="top|middle|bottom|baseline">

Attribute Value

ValueDescription
topAligns content upward.
middleAligns content to the center (default value).
bottomAligns content downward.
baselineAligns content to the baseline. The baseline is an imaginary 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 size is 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 <colgroup> Tag