Open In App

HTML <td> charoff Attribute

Last Updated : 07 Feb, 2022
Improve
Improve
Like Article
Like
Save
Share
Report

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

Note:  The <td> charoff attribute is not supported by HTML5.  

Syntax:

<td charoff="number">

Attribute Values:

  • number: It contains the numeric value which specifies the alignment of the td element.
    • Positive values: Indicate the alignment to the right of the characters.
    • Negative values: Indicate the alignment to the left of the characters.

Example: Below HTML code illustrates the use of charoff attribute in <td> element. 

HTML




<!DOCTYPE html>
<html>
  
<head>
    <title>HTML td charoff attribute </title>
    <style>
        body {
            text-align: center;
        }
          
        h1{
            color: green;
        }
          
        th {
            color: blue;
        }
          
        table,
        tbody,
        td {
            border: 1px solid black;
            border-collapse: collapse;
        }
    </style>
</head>
  
<body>
    <center>
        <h1>GeeksforGeeks</h1>
        <h2> HTML td charoff Attribute</h2>
        <table>
            <thead>
                <!-- tr tag starts here -->
                <tr align="char" charoff=".">
                    <th>Country_name</th>
                    <th>Ranking</th>
                </tr>
            <thead>
            <tbody>
                <tr>
                    <td align="char" charoff="." >
                    China</td>
                    <td>34</td>
                </tr>
                <tr>
                    <td>India</td>
                    <td>45</td>
                </tr>
            </tbody>
        </table>
    </center>
</body>
</html>


Output:

HTML 

<td> charoff Attribute” class=”aligncenter”><figcaption>HTML <td> charoff Attribute</figcaption></figure>
<p><strong>Supported Browsers:</strong></p>
<ul>
<li>Google Chrome <i>Not supported</i></li>
<li>Internet Explorer <i>Not supported</i></li>
<li>Firefox <i>Not supported</i></li>
<li>Apple Safari <i>Not supported</i></li>
<li>Opera <i>Not supported</i></li>
</ul>
<br/><div id=

Like Article
Suggest improvement
Share your thoughts in the comments

Similar Reads