How to add css class to a table created using views I want to add a css class to a table which is created using views. I tried to override "views-view-table.php" in my custom theme but that doesn't seems to work. In "views-view-table.php" I replaced the line "&lt;table &lt;?php if ($classes) { print 'class="'. $classes . '" '; } ?&gt;&lt;?php print $attributes; ?&gt;&gt;" with "&lt;table class="responsive"&gt;" and then cleared the cache, yet it didn't work. Can any one help. Thanks in advance.
This is an old post, but I'd like to chime in with a couple of solutions. 

First, and this may not answer your question directly, but you can change the CSS selectors you are using to target the table. 

So, rather than using table.yourclass you could use .yourclass table. This can be accomplished by setting a custom class for the entire view under the advanced section.

Of course, this won't work if you are trying to add classes directly to the element as you might need to do with Bootstrap, i.e. table.table.table-striped.

The second solution will allow you to add the same classes to all your tables. In your template.php file, add the following: 

function THEME_preprocess_views_view_table(&amp;$vars) 
{
    $vars['classes_array'][] = 'table table-striped';
}


If you need to target a specific table, you can also check the $vars variable first to find the name of the view and display being called and only apply your classes to the ones you want to target. I haven't checked, but it's probably found in something like $vars['view']-&gt;current_display.

Finally, it's worth noting that Views does actually support custom classes on the table. The variables are called in the template files, there just isn't an option for it in the views GUI. This is an oversight in my opinion, but the module's devs don't seem to plan on fixing it. That said, a patch for it does exist (direct link).