Closed (fixed)
Project:
Views (for Drupal 7)
Version:
7.x-3.x-dev
Component:
table style
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
8 Dec 2011 at 16:35 UTC
Updated:
29 Oct 2014 at 09:26 UTC
Jump to comment: Most recent
Comments
Comment #1
merlinofchaos commentedThere's no real way to do this in the current architecture. The answer is to fix your column widths so they match. This is not a bug.
Comment #2
sirtetThanks.
I did not want to set the widths, so they could be set automatically depending on content.
And also from the reader's logic i think in many (most?) cases, all results in one table make more sense, because it's all the same data.
By saying "...no real way to...", do you mean that you can't access the data for thead outside the loop that outputs the groups?
Or is there another big downside to my approach?
So i did a (dirty?) solution which did not require much understanding of all the code behind,
by altering the tpl-files like this:
copied the
views-view.tpl.phptoviews-view--[view-name]--page.tpl.phpand added the table-tag around the $rows:
then copied
views-view-table.tpl.phptoviews-view-table--[view-name].tpl.phpremoved the table- and thead-tags, plus outputted the title in a new row spanning all cols, with a class so i can style it separately.
From looking at the code, i could not see if (and how) it would be possible to do a new view-style plugin with the approach i did, but i guess it should be not too hard...
Comment #3
mrfelton commentedI think we need an option to be able to specify wether the headers should repeat or not. In many cases it makes no sense to repeat the headers, and it can be really bad from an accessibility point of view where you have what is essentially one set of tabular data now being displayed in three distinct tables. Because the data is grouped by a certain field, doesn't (shouldn't) really mean it that it should be displayed as three completely different sets of data.
The issue of table widths can clearly be fixed by css but I think that's only a small part of this problem, hence I'm reopening this closed ticket.
Comment #4
mrfelton commentedMy quick workaround was to preprocess the view to get some additional classes in there so that we could hide the repeating headers.
Whilst it works visually, it still has accessibility issues because we have three tables for one set of tabular data.
Comment #5
merlinofchaos commentedAt this time that's not a workaround, that's the correct way to do it.
Not *everything* that's possible to do with Views can (or should) be doable in the UI.
Comment #7
iantresman commentedUsing D6, I found that if I grouped by the title, the title was showing for each row (in Tables, HTML Lists, etc).
To work around this, I created a new field which merely duplicated the title, and now I get a single table with the grouping field showing just once.
Another workaround, is to not display the Title as a link to the node, which in retrospect, makes sense.
Comment #8
shomoos commentedcan you clarify this please?
Comment #9
iantresman commented@shomoos’s
I created a new text field, and just used this as the "title". The module Automatic Nodetitles lets you hide and ignore the node's actual title field.
I guess that if you must use the actual node title, you can still create another field that just copies the actual node title, using rules, or Computed Field. Apparently you can also do this with Views Bulk Operations.