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

HTML Reference Manual

HTML Tag大全

HTML: <col> char attribute

This article introduces the HTML col char attribute, which specifies the alignment of the content related to the col element relative to a certain character. The char attribute can only be used when the align attribute is set to "char". The default value of the char attribute is the decimal point character of the page language.

 HTML <col> tag

Online Example

In the following HTML table, the content of the second column is aligned with the character point "." :

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>HTML <col> char attribute usage-Basic Tutorial(oldtoolbag.com)</title>
<style>table, th, td {    border: 1px solid black;</style>
</head>
<body>
<table style="width:100%">
  <col align="left">
  <col align="char" char=".">
  <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 See ‹/›

Browser Compatibility

IEFirefoxOperaChromeSafari

Note: All major browsers do not support the char attribute.

Definition and Usage

HTML5 The <col> char attribute is no longer supported.

The char attribute specifies the alignment of the content related to the col element relative to a character.

The char attribute can only be used when the align attribute is set to "char".

The default value of the char attribute is the decimal point character of the page language.

Syntax

<col char="character">

Attribute Value

ValueDescription
characterSpecifies the character to align the content with.
 HTML <col> tag