How can I add a CSS class to all the tables?
If your table is rendered using theme('table'), you can preprocess it from your theme function.

function my_theme_preprocess_table(&amp;$variables) {
  $variables['attributes']['class'][] = 'table';
}