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

HTML Reference Manual

HTML Tag Reference

HTML: <colgroup> charoff Attribute

In HTML5 does not support the <colgroup> charoff attribute. The charoff attribute sets the number of characters by which the content is aligned with the character specified by the char attribute. The charoff attribute can only be used if the char attribute is specified and the align attribute is set to "char".

 HTML <colgroup> tag

Online Example

In the following example, the content of the second column in the table is aligned two characters to the right of the character ".":

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>HTML <colgroup> charoff Attribute Usage-Basic Tutorial(oldtoolbag.com)</title>
<style>table, th, td {  border: 1px solid black;}</style>
</head>
<body>
<table style="width:100%">
  <colgroup align="left"></colgroup>
  <colgroup align="char" char="." charoff="2></colgroup>
  <tr>
    <th>Month</th>
    <th>Savings</th>
  </tr>
  <tr>
    <td>January</td>
    <td>$100.00</td>
  </tr>
  <tr>
    <td>February</td>
    <td>$10.00</td>
  </tr>
</table>
</body>
</html>
Test to see ‹/›

Browser Compatibility

IEFirefoxOperaChromeSafari

Note:Almost all mainstream browsers do not support the charoff attribute.

Definition and Usage

In HTML5 In this context, the charoff attribute of <colgroup> is not supported.

The charoff attribute sets the number of characters to align the content with the character specified by the char attribute.


The charoff attribute can only be used when the char attribute is specified and the align attribute is set to 'char'.

Syntax

<colgroup charoff="number">

Attribute value

ValueDescription
numberDefine the alignment method.
Positive numbers are aligned to the right of the character.
Negative numbers are aligned to the left of the character.
 HTML <colgroup> tag