- This topic is empty.
Viewing 4 posts - 1 through 4 (of 4 total)
Viewing 4 posts - 1 through 4 (of 4 total)
- The forum ‘CSS’ is closed to new topics and replies.
The forums ran from 2008-2020 and are now closed and viewable here as an archive.
I am trying to hack a third party component with CSS. I can't change the HTML or add JS, so I am looking for a CSS solution. I don't think one is possible.
I have a simple <table>, with 3 <td>s in each <tr>. There are some cells that are .off. If the first row has all .off cells, I need to remove the row (display: none). If the first row has only 1 or 2 .off cells, I need to right align the remaining cells.
Using display:none for .off makes the remaining cells left aligned. Using visibility: hidden will not remove the first row if all cells are .off.
See this for the full example:
https://jsbin.com/dacusulihu/1/edit?html,output
Here’s one way https://jsbin.com/pazuzuwamu/1/edit?html,css,output
Thanks Beveleyh . It is working
Ah, nice css-trick. I didn’t think to untable the table. This does work well with the caveat that the cells have explicit widths defined. I think in my case, this will work.
Thanks!