Open In App

HTML <td> charoff Attribute

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:



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




<!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:

Article Tags :