简单教程
提交运行
代码编辑器:
<script> function rows(){ document.getElementById('myTable').rules="rows"; } function cols(){ document.getElementById('myTable').rules="cols"; } </script> <table id="myTable"> <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="rows()">只显示行边界</button> <button type="button" onclick="cols()">只显示列边界</button> <p><b>注意:</b> rules属性在Internet Explorer 9之前版本不能正常显示</p>
运行结果: