Skip to content
Related Articles

Related Articles

Improve Article
Save Article
Like Article

HTML | <col> charoff Attribute

  • Last Updated : 31 Oct, 2019

The HTML <col> charoff attribute is used to set the number of characters that aligned the characters specified by the char attribute. This attribute can only be used in the char attribute and align attribute is specified in the <col> element.

Syntax:

Attention reader! Don’t stop learning now. Get hold of all the important HTML concepts with the Web Design for Beginners | HTML  course.

<col charoff="number">

Attribute Values: It contains single value number which holds the numeric value specifies the alignment.

  • Positive values: It indicates the alignment to the right of the characters.
  • Negative values: It indicates the alignment to the left of the characters.

Note: This attribute is not supported by HTML 5.



Example:




<!DOCTYPE html> 
<html
  
<head
    <title
        HTML col charoff Attribute 
    </title
</head
  
<body
    <h1>GeeksforGeeks</h1
  
    <h2>HTML col charoff Attribute</h2
  
    <table border="1"
        <caption>Author Details</caption
  
        <col width="150" align="char" char="."
                    valign="top" charoff ="3"
        <col width="80" align="char" char="." 
                    valign="top" charoff ="3"
        <col width="120" align="char" char="."
                    valign="top"
          
        <tr
            <th>NAME</th
            <th>AGE</th
            <th>BRANCH</th
        </tr
        <tr
            <td>BITTU</td
            <td>22</td
            <td>CSE</td
        </tr
        <tr
            <td>RAM</td
            <td>21</td
            <td>ECE</td
        </tr
    </table
</body
  
</html>

Output:

Supported Browsers: This attribute is not supported by any browsers.




My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!