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

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

Browser support:
Sets or retrieves an alignment character. The alignment of the contents of the cells in the same column depends on this character. The first occurrence of the alignment character in each cell in a column will be on a vertical axis.
The functionality of this property is not implemented in commonly used browsers. For detailed technical information, visit the HTML 4.01 specification (W3C) site.

Syntax:

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

Possible values:

String that sets or retrieves the aligment character.
Default: this property has no default value.

Example HTML code 1:

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

    <button onclick="GetCh ();">Get 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