JavaScript 参考手册
Style borderCollapse 属性
返回 borderCollapse 属性
源代码:
点击运行 »
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>蜜蜂教程(mifengjc.com)</title> <style> td, th { border: 1px solid black; } </style> </head> <body> <table id="myTable" style="border-collapse:collapse;"> <tr> <th>月份</th> <th>储蓄</th> </tr> <tr> <td>一月</td> <td>$100</td> </tr> <tr> <td>二月</td> <td>$150</td> </tr> </table> <br> <button type="button" onclick="myFunction()">返回 border-collapse</button> <script> function myFunction() { alert(document.getElementById("myTable").style.borderCollapse); } </script> </body> </html>
运行结果:
点击运行 »