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


JAVASCRIPT DHTML TUTORIALS » HTML » Table »

 

Align the cell content in a single cell




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

<body>
<table id="myTable" border="1" width="100%">
<tr>
<td>First cell</td>
<td>Second cell</td>
</tr>
<tr>
<td>Third cell</td>
<td>Fourth cell</td>
</tr>
</table>
<form>
<input type="button" onclick="alignCell()" value="Align cell content">
</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