Change the cellPadding and cellSpacing of a table : Table : HTML JAVASCRIPT DHTML TUTORIALS


JAVASCRIPT DHTML TUTORIALS » HTML » Table »

 

Change the cellPadding and cellSpacing of a table




<html>
<head>
<script type="text/javascript">
function padding(){
    document.getElementById('myTable').cellPadding="25"
}
function spacing(){
    document.getElementById('myTable').cellSpacing="25"
}
</script>
</head>
<body>

<table id="myTable" border="1">
    <tr>
        <td>a</td>
        <td>b</td>
    </tr>
    <tr>
        <td>c</td>
        <td>d</td>
    </tr>
</table>
<form>
    <input type="button" onclick="padding()" value="Change Cellpadding">
    <input type="button" onclick="spacing()" value="Change Cellspacing">
</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