Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial

Barry Ort
12,373 PointsTable row background color
I'm trying to set a background color on a whole table row when the mouse hovers over it. the problem is that the table has cell spacing and the background color doesn't come up on the white space. I tried collapsing the cell spacing and applying padding to each cell instead but the problem with that is that the cells have a bottom border and if the cell spacing is collapsed the borders connect to each other creating one long line. Does anyone have a suggestion?
2 Answers

Barry Ort
12,373 PointsThe solution that worked for me was to collapse border collapse and add additional empty cells between the existing cells ti create white space.

Steven Parker
242,284 PointsHere's one idea.
Using padding instead of spacing is a good start. But instead of padding the cell itself, place a container (perhaps a <div>
) in each cell and adjust both padding and margin on that. Then apply the bottom borders to those containers instead of the cells.

Barry Ort
12,373 Pointsyeah that's an idea. I started doing that but I didn't have enough time to work the whole thing thru. (The nested divs have to be the same dimensions as the parent cells in order for the the bottom border to line up with the cell bottom.) But I like the idea! Thanks!