<!DOCTYPE html> <html> <head> <style type="text/css"> table { border-collapse: separate; empty-cells: hide; } </style> </head> <body> <table border="1"> <tr> <td>Adams</td> <td>John</td> </tr> <tr> <td>Bush</td> <td></td> </tr> </table> <p><b>注释:</b>如果已规定 !DOCTYPE,那么 Internet Explorer 8 (以及更高版本)支持 empty-cells 属性。</p> </body> </html>
本文案例为大家展示了《如何显示表格中的空单元》的代码,若要看代码效果请大家点击“运行代码”按钮。(请在非 IE 浏览器中浏览)
[code]<!DOCTYPE html> <html> <head> <style type=”text/css”> table { border-collapse: separate; empty-cells: hide; } </style> </head> <body> <table border=”1″> <tr> <td>Adams</td> <td>John</td> </tr> <tr> <td>Bush</td> <td></td> </tr> </table> <p><b>注释:</b>如果已规定 !DOCTYPE,那么 Internet Explorer 8 (以及更高版本)支持 empty-cells 属性。</p> </body> </html>[/code]