当前位置: 首页 > 网络学院 > 客户端脚本教程 > HTML DOM > HTML DOM cellPadding 属性
The cellPadding property sets or returns the amount of space (in pixels) between the cell border and cell content.
cellPadding属性可设置或返回每个cell边到cell内容之间的空间(类似padding)
tableObject.cellPadding=number |
<html> <head> <script type="text/javascript"> function padding() { document.getElementById('myTable').cellPadding="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="padding()" value="Change Cellpadding"> </form> </body> </html> |
Change the cellPadding and cellSpacing of a table
改变表格的cellPadding和cellSpacing