Question: I'm trying to override a view table from within my module. I can't locate what the arguments are suppose to be and in what order (for my hook\_theme func). I copied the theme file from views/themes and did no modifications. Does anyone know what is going wrong, and what should the arguments value be below?

My theme configuration is currently:

```
'views_view_table__opportunities_mentions' => array(
  'arguments' => array(
    'view' => NULL, 
    'title' => NULL, 
    'header' => NULL, 
    'fields' => null, 
    'class' => null, 
    'row_classes' => null, 
    'rows' => null
  ),
  'template' => 'views-view-table--opportunities-mentions',
  'original hook' => 'views_view_table',
  'path' => drupal_get_path('module', 'smd') . '/theme',
),

```

Answer: 
The easiest way to theme views is to edit the particular view in question and scroll down to find the link 'theme information'. This screen will tell you exactly what views theming templates that it is currently using and what templates you can make in your theme to override this output.

That essentially all views theming is - overriding the default markup with something to suit you designs.

@see <http://www.group42.ca/theming_views_2_the_basics> for an excellent tutorial on views theming

**EDIT**

If you want full control over the markup produced, *and* for this to be portable across themes, the only option you have is to create a custom module. This custom module could also have themeable components, and could even use a view to perform any heavy SQL (or you could just hand-write the SQL)

Take a look at a similiar module to get you started, and have a read through [hook\_theme](http://api.drupal.org/api/drupal/modules--system--system.api.php/function/hook_theme/6)
It's way better to preprocess the view.

If you want to override just a particular display, you need to be specific. You must first create a tpl.php file for the view. You can figure out which one you want by looking at the theme information for your particular view. Here is an example:

![enter image description here](https://i.stack.imgur.com/pk1GA.jpg)
You then want to find the template suggestions of row style, which is currently 'Table':

![enter image description here](https://i.stack.imgur.com/w7WBJ.jpg)

*views-view-table.tpl.php* will override **every** view that has a table style. If you want to be specific to just this view, you're going to want (in this case) *views-view-table--frontpage.tpl.php* - replace 'frontpage' with whatever suggestions your view is giving you.

You actually need to create this file in your theme directory. But what do you put in this file? Well, just click that 'Style output' link, and you will be presented with code that you can simply copy and paste right into that file.

After saving this file, open up your template.php and create a preprocessor for it. Note that preprocessors *do not work* without the file being present in D6. Here is some stub code, keeping with our example:

```
function [theme-name]_preprocess_views_view_table__frontpage(&$vars) {
  // manipulate the $vars here
  ...
}

```

$vars is passed by reference so you only have to manipulate the appropriate keys to do what you want.