专注前端素材!
源代码:
点击运行
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>素材8网教程(study.sucai8.cn)</title> <style> table.ex1 { border-collapse:separate; border-spacing:10px; } table.ex2 { border-collapse:separate; border-spacing:10px 50px; } </style> </head> <body> <table class="ex1" border="1"> <tr> <td>Peter</td> <td>Griffin</td> </tr> <tr> <td>Lois</td> <td>Griffin</td> </tr> </table> <br> <table class="ex2" border="1"> <tr> <td>Cleveland</td> <td>Brown</td> </tr> <tr> <td>Glenn</td> <td>Quagmire</td> </tr> </table> <p><b>注意:</b>仅当 !DOCTYPE 已经定义时 IE8支持 border-spacing 属性</p> </body> </html>
运行结果