You are here: Reference > JavaScript > client-side > HTML DOM > properties > chOff (col, tbody, td, th, tr, ...)

chOff property (col, tbody, td, th, tr, ...)

Browser support:
Sets or retrieves the horizontal offset of the ch and char properties. The direction of the offset is the same as the direction of the text (dir property).
There isn't any functionality implemented for this property in commonly used browsers. For detailed technical information, visit the HTML 4.01 specification (W3C) site.

Syntax:

object.chOff;
You can find the related objects in the Supported by objects section below.
This property is read/write.
HTML page for this property: chOff

Possible values:

Sets or retrieves the horizontal offset of the alignment character.
One of the following values:
offset in pixel
Signed integer with or without a px (pixel) designator.
offset in percentage
Floating-point number with % designator. The offset is the signed percentage of the width of the object.
Default: this property has no default value.

Example HTML code 1:

This example illustrates the use of the charOff and chOff attributes, but they have no effect in browsers:
<table border="1px">
    <colgroup>
        <col />
        <col align="char" ch="." char="." chOff="20px" charOff="20px"/>
    </colgroup>
    <tbody>
        <tr>
            <td>Apple</td>
            <td>$5.50</td>
        </tr>
        <tr>
            <td>Pear</td>
            <td>$10.50</td>
        </tr>
    </tbody>
</table>
Did you find this example helpful? yes no

Example HTML code 2:

This example illustrates the use of the charOff property, but it has no effect in commonly used browsers:
<head>
    <script type="text/javascript">
        function GetChOff () {
            var col = document.getElementById ("myCol");
            alert ("The offset of the alignment character for the column: " + col.chOff);
        }
    </script>
</head>
<body>
    <table border="1px">
        <colgroup>
            <col />
            <col id="myCol" align="char" ch="." char="." chOff="20px" charOff="20px" />
        </colgroup>
        <tbody>
            <tr>
                <td>Apple</td>
                <td>$5.50</td>
            </tr>
            <tr>
                <td>Pear</td>
                <td>$10.50</td>
            </tr>
        </tbody>
    </table>

    <button onclick="GetChOff ();">Get the offset of the alignment character</button>
</body>
Did you find this example helpful? yes no

Supported by objects:

Related pages:

External links:

User Contributed Comments

Post Content

Post Content