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

HTML Referenzhandbuch

HTML-Tag-Liste

HTML: <colgroup> span Attribute

Dieser Artikel beschreibt die Verwendung des HTML colgroup span Attributes, zeigt Beispiele zur Verwendung des HTML colgroup span Attributes, Kompatibilität der Browser, Syntaxdefinition und detaillierte Informationen zu seinen Attributwerten.

 HTML <colgroup> Tag

Online-Beispiel

Verwenden Sie die <colgroup span>-Attribute, um die Hintergrundfarbe der ersten zwei Spalten zu setzen:

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>HTML <colgroup> span Attribute Verwendungsweise-基础教程(oldtoolbag.com)</title>
<style>table, th, td {    border: 1px solid black;}</style>
</head>
<body>
<table>
  <colgroup span="2<style="background:red"></colgroup>
  <tr>
    <th>ISBN</th>
    <th>Title</th>
    <th>Price</th>
  </tr>
  <tr>
    <td>3476896</td>
    <td>My first HTML</td>
    <td>$53</td>
  </tr>
  <tr>
    <td>5869207</td>
    <td>My first CSS</td>
    <td>$49</td>
  </tr>
</table>
</body>
</html>
Test it out ‹/›

Browser Compatibility

IEFirefoxOperaChromeSafari

All major browsers support the span attribute.

Definition and Usage

The span attribute defines the number of columns the <colgroup> element should span across.

Tip:To define different attributes for the columns within <colgroup>, use the <colgroup> tag. <col> Tags.

HTML 4.01 with HTML5differences

None.

Syntax

<colgroup span="number">

Attribute Value

ValueDescription
numberSet the number of columns that should span across.
 HTML <colgroup> Tag