Open In App

HTML <th> charoff Attribute

The HTML th charoff Attribute is used to sets 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 th Element.

Note:  The th charoff attribute is not supported by HTML 5. 



Syntax:

<th charoff="number">

Attribute Values:



  1. Positive values: indicate the alignment to the right of the characters.
  2. Negative values: indicate the alignment to the left of the characters.

  
 

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

 




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

Output:

Supported Browsers: This attribute is depreciated from HTML5 and not in use.
 


Article Tags :