当前位置: 首页 > 网络学院 > 客户端脚本教程 > HTML DOM > HTML DOM cellSpacing 属性
The cellSpacing property sets or returns the amount of space (in pixels) between cells in a table.
cellSpacing属性可设置或返回表格cell与cell之间的距离
tableObject.cellSpacing=number |
<html> <head> <script type="text/javascript"> 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> <form> <input type="button" onclick="spacing()" value="Change Cellspacing"> </form> </body> </html> |
Change the cellPadding and cellSpacing of a table
改变表格的cellPadding和cellSpacing