Mykroft Mykroft - 1 year ago 75
CSS Question

How do I put a border around a tr tag?

I have a very simple html page:


With some simple css:

border:1px solid blue;

I would expect this to put a border around the trs but it doesn't put a border around it at all. How do i get a border around the tr?

Answer Source

Add table { border-collapse: collapse; }.

From the CSS2 specification:

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).

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download