A common desire with the grid style is to have columns display with equal widths to have a nice even grid. Table cells expand depending on their content, so if you have, say, different lengths of node titles in your results, it can get uneven easily.
The td tags have column counts on them, but there's no way to generically know how many columns are in a table, unless you target the specific view. If the table tag had a class like "cols-4" on it, it would be easy to do a table.cols-4 td { width: 25%; } to even out the columns.
Comments
Comment #1
dawehnerHere is a patch. If this patch is not accepeted you can still do this same in your own theme_preprocess_views_view_table
Comment #2
merlinofchaos commentedSimple enough. Committed to all branches.
Comment #4
doublejosh commentedNice. Been wanting to suggest this for a while. Can't wait for it to get into the next release.
Comment #5
doublejosh commentedThis seems to have been a patch for table style not grid style. Suppose the table one needed it too :)
Thought I could add this to line 470, but it seems $vars['classes'] is not used on this preprocess function?
Comment #6
dawehnerShouldn't be this part of http://drupal.org/node/714836 ?
Comment #7
dboulet commentedWhy are we counting rows to generate a class called "cols"? The patch that was committed doesn't facilitate the requested feature at all.
Comment #8
merlinofchaos commenteddereine, can you look at this? I remember seeing something like this when I was messing with semantic views patch, and it felt like the cols- counting in general was counting rows, not columns, but I'm not totally sure.
Comment #9
dboulet commentedIt's definitely counting rows.
Comment #10
merlinofchaos commentedBecause of the semantic views patch I suspect we need separate patches for 2.x and 3.x
Comment #11
merlinofchaos commentedCommitted fix to all branches.