Closed (fixed)
Project:
Views (for Drupal 7)
Version:
6.x-2.0-rc1
Component:
table style
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
6 Aug 2008 at 11:52 UTC
Updated:
20 Aug 2008 at 20:13 UTC
Hi there,
In Table style, the width of each column is allocated depending on the maximum width of the content displayed in it. This is an excellent and effective system.
When using the 'group by field' function, however, that calculation is applied to each group individually, rather than globally. While that does mean that, technically, the columns in each group are the optimum width for the content in the group, it makes for an untidy page, and a confusing layout, as the fields are not aligned vertically throughout all the groups.
I've attached a screenshot to illustrate the situation.
is there a way to remedy this?
| Comment | File | Size | Author |
|---|---|---|---|
| Table-style-column-widths.jpg | 57.23 KB | Osfer |
Comments
Comment #1
merlinofchaos commentedThe way to remedy this is via CSS; you'll need to apply some CSS to your table cells to ensure that they all have consistent width. Views has no idea how wide each cell should be and ordinarily just lets the browser decide, but in this situation that obviously doesn't work.
It is pretty easy to use CSS to pick out individual table cells and apply a width: property to them; using a percentage width is recommended, though do be careful that if a property has a value big enough to go over that it could expand beyond its stated width (but overflow: hide can help alleviate that).
Comment #2
Osfer commentedThanks Merlin, it sounds like the only solution for consistent cell widths across field-grouped tables in a view is to hardcode the column widths. It's a shame that this precludes the intelligent width-determination based on the content in all the visible cells in a column, but I understand that it's not Views' responsibility. Thanks for clearing that up!
Comment #3
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.