Add a table class name to a View table Can I add a custom table class name to a View that outputs a table, Or just add the name of the view to the table class name? There isn't a setting in Views to add a table class name, you can only add row class names.

My View name is view-a1. I would like to the name of the View to all table class names.I am trying to do it with hook_preprocess_views_view_table. But I don't know how.

The default twig template uses this markup
 

The method in the url below worked, it will add a custom hardcoded table class name. I changed the hook in the example to hook_preprocess_views_view_table. What I really want to do it add the name of the View as the table class name. How can I do that?

https://www.drupal.org/docs/8/theming-drupal-8/modifying-attributes-in-a-theme-file
Views have the CSS class option under Advanced (third column). There you can set the class to be output to all displays of that Views or override for single Displays. 

Most themes won't output that class directly on the &lt;table&gt; element, it is usually output on a &lt;div&gt; that contains the table. 

That can be enough for styling in CSS, but if you want you can override the twig template or use the preprocess function in your theme for more control.