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 actually looks mostly correct to me, I used the same code in my module. I wanted to package my template file with my view in the module. As the site uses the regular bartik theme for admin and I didn't want to edit that theme to add my CSS.

What I believe is wrong is the following:

```
'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',
'base hook' => 'views_view_table',
'path' => drupal_get_path('module', 'smd') . '/theme',
),

```

Note that instead of `original hook`, it should be `base hook`. This is required that view has own preprocess functions to be correctly wired to your tpl. If you don't set that correctly it will pick up your custom tpl anyway, but you'll get all kinds of errors about missing or null variables in the tpl because the preprocess function didn't set any of the variables that the tpl uses.