Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Good way to add some space between html table rows using css? Works across all browsers including IE6

Tags:

html

css

What's a good way to add some space between html table rows using css? Should work in all browsers including IE6. Should use id or class so it doesn't affect every table in the site. Prefer to declare the css at the table level. Don't want to use empty tr's to simulate a blank row. css should not affect any inner tables.

Logically I tried this but margins don't work with tr's:

.someclass tr
{
  margin-bottom:20px;
}
like image 803
Tony_Henrich Avatar asked May 18 '11 17:05

Tony_Henrich


1 Answers

You could use:

.someclass td {padding-bottom: 20px;} 

It's unfortunately not that intuitive but it works on IE6 and all the other browsers. You can also do it with a border:

.someclass td {border-bottom: 20px solid white;}

Edit

To exclude an inner table you could use:

.someclass td td {padding-bottom: 0px;}
like image 76
Brian Fisher Avatar answered Oct 03 '22 10:10

Brian Fisher