更改表格的 cellPadding 和 cellSpacing
- <html>
- <head>
- <script type="text/javascript">
- function padding()
- {
- document.getElementById('myTable').cellPadding="15"
- }
- function spacing()
- {
- document.getElementById('myTable').cellSpacing="15"
- }
- </script>
- </head>
- <body>
- <table id="myTable" border="1">
- <tr>
- <td>100</td>
- <td>200</td>
- </tr>
- <tr>
- <td>300</td>
- <td>400</td>
- </tr>
- </table>
- <br />
- <input type="button" onclick="padding()" value="改变 Cellpadding">
- <input type="button" onclick="spacing()" value="改变 Cellspacing">
- </body>
- </html>