我有一个非常简单的html页面:
<table> <tr><th>header1</th><th>header2</th></tr> <tr><td>item1</td><td>item2</td></tr> <tr><td>item3</td><td>item4</td></tr> </table>
用一些简单的css:
tr { border:1px solid blue; }
我希望这可以在trs周围放置一个边框,但是它根本不会在其周围放置边框.我如何得到一个边界?
解决方法
添加表{border-collapse:collapse; }.
In [the
border-collapse: separate
model],each cell has an individual border. […] Rows,columns,row groups,and column groups cannot have borders (i.e.,user agents must ignore the border properties for those elements).