HTML DOM align Property
Complete TableCell Object Reference
Definition and Usage
The align property sets or returns the horizontal alignment of data within
a table cell.
Syntax
tabledataObject.align=left|right|center
|
Example
The following example aligns a table cell to the right:
<html>
<head>
<script type="text/javascript">
function alignCell()
{
document.getElementById('td1').align="right"
}
</script>
</head>
<body>
<table border="1">
<tr>
<th>Firstname</th>
<th>Lastname</th>
</tr>
<tr>
<td id="td1">Peter</td>
<td id="td2">Griffin</td>
</tr>
</table>
<br />
<input type="button" onclick="alignCell()"
value="Align cell" />
</body>
</html>
|
Try-It-Yourself Demos
Change the alignment of a <td> element
Complete TableCell Object Reference
|
|
|
See why there are 20,000+ Ektron integrations worldwide.
Request an INSTANT DEMO or download a FREE TRIAL today. |
|
|
|