Open In App

HTML | <col> charoff Attribute

Improve
Improve
Like Article
Like
Save
Share
Report

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:

<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.



Last Updated : 31 Oct, 2019
Like Article
Save Article
Previous
Next
Share your thoughts in the comments
Similar Reads