I've been searching through here and haven't found a solution. I'm using a Style: Table for my View and need to convert columns to rows. What I mean by that is currently the default is table header top to bottom content. What I need is table header left to right content in a row instead. Wish there was an option for this but I don't see it. Can any one please give me some direction?

Much appreciated,
Danny

Comments

dawehner’s picture

There was someone, who asked the exact same stuff, as far as i understand what you are asking,
but there are too many people asking in the queue, so i cannot find it.

Basically you can do this using preprocess_views_table.

Anonymous’s picture

I guess everyone has been asking the question differently than I because I never caught it. Thanks for the heads up. That will help in my keyword search.

Cheers

Anonymous’s picture

dawehner’s picture

Status: Active » Fixed

exact.

Thx for finding it.
So this is fixed.

Anonymous’s picture

Sorry dereine, can I trouble you to tell me where exactly this snippet is inserted? i'm not a programmer and having from trouble understanding the post in that link. Many thanks.

dawehner’s picture

This snippet has to be added in template.php

Anonymous’s picture

Thanks. I've tested it at the top and bottom of the template.php and its not having any effect. Does this snippet require me to insert any additional data? e.g. labels.

Thanks again

dawehner’s picture

Did you replaced custom with your themename and cleared the cache?

<?php

function custom_preprocess_views_view_table(&$vars) {
Anonymous’s picture

That was it! Thank you so much dereine for your time. Greatly appreciated and I think this newbie learned a thing or two.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

WorldFallz’s picture

Version: 6.x-2.6 » 6.x-3.x-dev
Status: Closed (fixed) » Active

I'm working on a module and docs to implement the linked solution in #3 and so far it still seems to work on views3. The only problem I can't seem to solve, and it existing with views2 as well, is that none of the $field_classes show up in the table. I could always make a custom tpl.php file, but it would be really nice to keep this all in the preprocess function. Has anyone solved this yet?

iamjon’s picture

Status: Active » Closed (fixed)