I have a view that displays a table:
- rows represent days – one row per day
- columns represent my group entity – each column head display group name and a + icon that expands the group into several additional columns that represent group items; so basically I have expandable column grouping; only one group will be expanded at a time;
When user clicks on the + beside group name, a series of columns should be added to this table each representing calendar data of each of these group items. In other words a group will be expanded to its items. If any other group has been displayed so far, it will be contracted before the new one will get expanded.
My form is Ajax powered. When page loads only calendar worw are filled and group headers are added to columns.
Problems
-
I’m not sure how to implement this table in the first place? Whould I use
tableelement or use floateddiv/ul? All content cells (not headers and not first column with calendar dates) have the same dimension so I could use other things than a table. Why do I lean towarddiv/ulimplementation? Because with floating it would be easier to dynamically load additional columns that represent group items. I suppose this would be tricky to implement using tables, because we can’t have column groups as we can haveTBODYelements of column rows (transposing this data is not possible). -
Since my columns widths have to be the same as well I have to display group and item names vertically. This way all columns will have the same width but they have to display text this way in IE (if possible V7+), FF and CH.
Questions
-
How do you suggest this view should be done (using
tableordiv/ulelements)? You can also suggest a completely different alternative that didn’t come to my mind; maybe you’ve implemented something similar yourself… -
How to reliably rotate text of my headers? I’ve seen matrix filters on IE and transforms on mozilla and webkit browsers, but text looks positioned out of the original content box. I’ve also seen SVG implementations but I don’t know about its browser support (AFAIK IE doesn’t support it without plugins).
-
Is there a way I can keep columns with the same width but don’t use text rotation?
Solution that works on FF, CH and IE
This is what I ended up with and works rather well across different major browsers (FF, CH and IE). I tested it in IE8 and it worked and it also works in IE9. So here it is for future reference in case you may need it yourself:
Rotated text still keeps dimensions before transformation so it’s best to contain it within a different element that actually gives it vertically equivalent dimension. This way other content flow doesn’t break.
This is the simplified HTML code:
and accompanying CSS: