borderCollapse 属性设置表格的边框是否被合并为一个单一的边框,还是象在标准的 HTML 中那样分开显示。
</>code
- Object.style.borderCollapse=collapse|separate
值 | 描述 |
---|---|
separate | 边框会被分开。 |
collapse | 默认。如果可能,边框会被合并为一个单一的边框。 |
下面的例子合并表格边框:
</>code
- <html>
- <head>
- <script type="text/javascript">
- function setBorderCollapse()
- {
document.getElementById('myTable').style.borderCollapse="collapse"
- }
- </script>
- </head>
- <body>
- <table border="1" id="myTable">
- <tr>
- <td>100</td>
- <td>200</td>
- </tr>
- <tr>
- <td>300</td>
- <td>400</td>
- </tr>
- </table>
- <br />
- <input type="button" onclick="setBorderCollapse()"
- value="Collapse border">
- </body>
- </html>
如对本文有疑问,请提交到交流论坛,广大热心网友会为你解答!! 点击进入论坛
Powered by 365建站网 RSS地图 HTML地图
copyright © 2013-2024 版权所有 鄂ICP备17013400号