4 ms·
> Table rows, trs, cannot be styled unless you set border-collapse: separate; on the parent table. I don't recall any trouble applying styles to tr elements wi
by bhauer 13y ago
> Table rows, trs, cannot be styled unless you set border-collapse: separate; on the parent table.
I don't recall any trouble applying styles to tr elements without having to do anything special to the parent table.
Setting the border-collapse to "collapse" explicitly just to test:
http://jsfiddle.net/x3Pkd/ http://jsfiddle.net/x3Pkd/
What am I missing here?
- deleted 13y ago[deleted]
- Pwntastic 13y agoIt looks like Chrome's default user agent stylesheet defaults table border-collapse to separate. So you don't necessarily have to set it, but it's required and will potentially confound you if you use a css reset that changes this.
- bzbarsky 13y agoThe initial value of 'border-collapse' in the absence of any user/document/UA styles is "separate". See http://www.w3.org/TR/CSS21/tables.html#propdef-border-collapse http://www.w3.org/TR/CSS21/tables.html#propdef-border-collap... If you have a "CSS reset" that resets it to a non-initial value, that seems like a bug in that "CSS reset", no?
- Pwntastic 13y agoAh. Well I hadn't checked the spec; I just meant that in my 5 minute testing it appeared that chrome set border-collapse to separate by default, which would explain why the parent commenter didn't ever have to set it to see table styles.
- mdo 13y agoApologies for this, I was trying to be brief and lost most of the meaning in that one last night. I've updated it to better communicate the potential problem folks can run into.
- bhauer 13y agoAha! Your clarification makes a lot of sense. Thanks!