首页
极刻
圈子
教程
开源
登录 / 注册
返回教程:Javascript 参考手册
TRY RUN / 在线示例
Javascript 参考手册 尝试一下
Javascript 参考手册 尝试一下
源代码
运行
<!DOCTYPE html> <html> <head> <script> function show() { document.getElementById("myTable").style.emptyCells="show"; } function hide() { document.getElementById("myTable").style.emptyCells="hide"; } </script> </head> <body> <table id="myTable" border="1"> <tr> <th>Month</th> <th>Savings</th> </tr> <tr> <td>January</td> <td>$100</td> </tr> <tr> <td>February</td> <td></td> </tr> </table> <br> <button type="button" onclick="show()">Show empty cells</button> <button type="button" onclick="hide()">Hide empty cells</button> <p><b>Note:</b> Internet Explorer 8 supports the empty-cells property only if a !DOCTYPE is specified.</p> </body> </html>
运行结果