Equal inner table cell spacing - just CSS width and padding
11 months 1 week ago
Instead of padding the left and right side of all your table cells you only want to pad the inner cells. You want the table of images, perhaps, to fill the entire content area, but you want the images spaced the same inside the content.
Also, you may not have control over the markup of the site, and need to just use width and padding for the four cells.
This requires some math. Lets start with 4 cells.
[22 | >3] [<1 | 22% | >2] [<2 | 22% | >1] [<3 22%]
The trick is to have the cell width + padding all be the same and the padding total of each of the inner two edges also be the same. The code below uses the views grid markup in Drupal 7.
4 Column Table CSS Code
3 Column Table CSS Code
2 Column Table CSS Code