Latest web development tutorials

HTML colgroup span properties

Tag Reference HTML colgroup HTML <colgroup> tag

Examples

Use <colgroup> span attribute is set before the two background color:

<table border="1">
<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>

try it"

Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support span property.


Definition and Usage

span attribute defines the number of columns <colgroup> element should be spanned.

Tip: To define a column <colgroup> within different properties, use within <colgroup> tag <col> tag.


Differences between HTML 4.01 and HTML5

no.


grammar

<colgroup span="number">

Property Value

描述
number 设置列组应该横跨的列数。


Tag Reference HTML colgroup HTML <colgroup> tag