Align the cell content in a table row : Table : HTML JAVASCRIPT DHTML TUTORIALS


JAVASCRIPT DHTML TUTORIALS » HTML » Table »

 

Align the cell content in a table row




<html>
<head>
<script type="text/javascript">
function alignRow(){
    var x=document.getElementById('myTable').rows
    x[0].align="right"
}
</script>
</head>

<body>
<table width="60%" id="myTable" border="1">
<tr>
<td>1</td>
<td>2</td>
</tr>
<tr>
<td>1</td>
<td>2</td>
</tr>
<tr>
<td>1</td>
<td>2</td>
</tr>
</table>
<form>
<input type="button" onclick="alignRow()" value="Align first row">
</form>
</body>

</html>



           
       



-

Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .

Follow Navioo On Twitter

JAVASCRIPT DHTML TUTORIALS

 Navioo HTML
» Table