JavaScript 参考手册
Table frame 属性
下面的例子设置了表格的两种不同的边框
源代码:
点击运行 »
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>蜜蜂教程(mifengjc.com)</title> <script> function above() { document.getElementById('myTable').frame = "above"; } function below() { document.getElementById('myTable').frame = "below"; } </script> </head> <body> <table id="myTable" border="1"> <tr> <td>cell 1</td> <td>cell 2</td> </tr> <tr> <td>cell 3</td> <td>cell 4</td> </tr> </table> <br> <button type="button" onclick="above()">显示上面的边框</button> <button type="button" onclick="below()">显示底部边框</button> <p><b>Note:</b>frame属性在Internet Explorer 9之前版本不能正常显示。</p> </body> </html>
运行结果:
点击运行 »