I have fresh Drupal 6.19, Views 2.11, Garland
I've created a view with table style. I grouped tables by one of the field. I have 4 grouped tables
After looking in source of page I saw:

How to add different class for every table?
in views-view-table.tpl.php I see
print $class; "> Which logic to use to make class different foe every table?
Thanks

Comments

shane birley’s picture

Status: Active » Postponed (maintainer needs more info)

You would need to add something currently available in each node, I would think. Adding a class to each row may help out or adding something from the content type.

Are the contents in the View of the same content type or are they all different?

AlexanderPop’s picture

thanks for reply. same
so use field?
something like
<?php print $node->field_introduction[0]['value']?>
my view currently generates tables

<table class="views-table cols-2">
<table class="views-table cols-1">
<table class="views-table cols-1">
<table class="views-table cols-1">
alexrayu’s picture

One option is to add a unique class from $title variable like this:

In: views-view-table.tpl.php line 20

<?php
  $xtitle = str_replace(' ', '-', $title);
  if(strlen($xtitle)>12){$xtitle=strtolower(substr($xtitle,0,12));}
?>
<table class="<?php print $class . ' ' . $xtitle; ?>">
AlexanderPop’s picture

Thank you Alexei Rayu
It works as I need. Thanks again

shane birley’s picture

Status: Postponed (maintainer needs more info) » Fixed

Rock on!

Status: Fixed » Closed (fixed)

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