HTML DOM align Property
Complete TableRow Object Reference
Definition and Usage
The align property sets or returns the horizontal alignment of data within
a table row.
Syntax
tablerowObject.align=left|center|right|justify|char
|
Example
The following example changes the alignment of the content in a table row:
<html>
<head>
<script type="text/javascript">
function leftAlign()
{
document.getElementById('header').align="left";
}
</script>
</head>
<body>
<table width="100%" border="1">
<tr id="header">
<th>Firstname</th>
<th>Lastname</th>
</tr>
<tr>
<td>Peter</td>
<td>Griffin</td>
</tr>
</table>
<br />
<input type="button" onclick="leftAlign()"
value="Left-align table row" />
</body>
</html>
|
Try-It-Yourself Demos
Align the cell content of a table row
Complete TableRow Object Reference
|