X
HOME HTML CSS JAVASCRIPT SQL PHP JQUERY XML ASP.NET MORE...
REFERENCES | EXAMPLES | FORUM | ABOUT

tr chOff Property

tr Object Reference tr Object

Definition and Usage

The chOff property sets or returns the horizontal offset of the ch property.

The chOff property sets the number of characters the content will be aligned from the character specified by the char attribute/ch property.

Syntax

Set the chOff property:

trObject.chOff="px|%"

Return the chOff property:

trObject.chOff

Tip: There is no default value for the chOff property.

Value Description
px Defines the horizontal offset in pixels
% Defines the horizontal offset in % of the width of the object


Browser Support

Internet Explorer Firefox Opera Google Chrome Safari

The chOff property is supported in all major browsers. However, the functionality of this property is not implemented in any of the major browsers.


Example

Example

Align the "Savings" column two characters to the right from the "." character:

<html>
<head>
<script>
function displayResult()
{
var c=document.getElementById("myCol");
alert("The horizontal offset of the ch property is: " + c.chOff);
}
</script>
</head>
<body>

<table border="1">
  <colgroup>
    <col>
    <col id="myCol" align="char" char="." charoff="2">
  </colgroup>
  <tr>
    <th>Month</th>
    <th>Savings</th>
  </tr>
  <tr>
    <td>January</td>
    <td>$100.00</td>
  </tr>
  <tr>
    <td>February</td>
    <td>$10.00</td>
  </tr>
</table>

<button type="button" onclick="displayResult()">Get horizontal offset of the alignment character</button>

</body>
</html> 

Try it yourself »


tr Object Reference tr Object

Your suggestion:

Close [X]

Thank You For Helping Us!

Your message has been sent to W3Schools.

Close [X]
Search w3schools.com:

WEB BUILDING

Download XML Editor FREE Website BUILDER Free HTML5 Templates FREE Website Templates Free HTML Templates

SHARE THIS PAGE

facebook