First pic below shows table layout prior to my CSS tweak. I’ve added red borders to TD cells just so you can see the structure of the table. This is the desired layout, expect I need gray divider lines below each row.
2nd pic shows what happens to the table after this line of CSS is introduced (to achieve table row divider lines that do not span full width of parent table)
After the first line, the layout appears to be fixed, except the table is appx 3px less wide than the container. Adding the 2nd line “width:auto!important” fixes that.
I might be missing the obvious but why can’t you apply a gray border-bottom to the bottom of the table-cell instead of using :after?
I’m not getting the same results as you on a similar test so we will probably need to see the html and css that makes up the demo. When you insert an :after element into a table-row then it effectively becomes another cell thrown into the mix (depending on browser) so results may be unreliable.
Thanks Paul, the original solution was exactly that:
.oolTable tr td{border-bottom:1px solid #ddd}
The problem with that approach is that the client came back and decided they did not want the borders to span the full width of the table. This is an existing legacy application that is getting a facelift via CSS, so the markup cannot be changed.
The blue header element is part of the same table and must extend full width left to right. However, the divider lines between rows cannot extend full width, hence I had to remove the very reliable and bulletproof border-bottom on the TD cells in favor of using the psuedo insert after each TR