HTML | <tr> charoff Attribute

The HTML tr 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 tr Element.

Syntax:

<tr charoff="number">

Attribute Values:

  • number: It contains the numeric value which specify the alignment.
  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:

filter_none

edit
close

play_arrow

link
brightness_4
code

<!DOCTYPE html>
<html>
  
<head>
    <title>tr charoff </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 tr charoff Attribute</h2>
        <table>
            <thead>
                <!-- tr tag starts here -->
                <tr align="char" charoff=".">
                    <th>Name</th>
                    <th>User Id</th>
                </tr>
                <!-- tr tag end here -->
            </thead>
            <tbody>
                <tr>
                    <td>Shashank</td>
                    <td>@shashankla</td>
                </tr>
                <tr>
                    <td>GeeksforGeeks</td>
                    <td>@geeks</td>
                </tr>
            </tbody>
        </table>
    </center>
</body>
  
</html>

chevron_right


Output:

Supported Browsers: The browsers supported by HTML tr charoff Attribute are listed below:

  • Google Chrome Not supported
  • Internet Explorer Not supported
  • Firefox Not supported
  • Apple Safari Not supported
  • Opera Not supported

full-stack-img




My Personal Notes arrow_drop_up

Check out this Author's contributed articles.

If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.


Article Tags :
Practice Tags :


Be the First to upvote.


Please write to us at contribute@geeksforgeeks.org to report any issue with the above content.