Index: tablefield/tablefield.module
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- tablefield/tablefield.module	(revision 2abbd28d221bb19cf15ccfce3532bcd61f74d8ed)
+++ tablefield/tablefield.module	(date 1520871596000)
@@ -561,6 +561,8 @@
         'trim_trailing_cols' => FALSE,
         'trim_trailing_rows' => FALSE,
         'export_csv' => FALSE,
+        'custom_class' => 'table',
+        'custom_attr' => '',
       ),
     ),
     'format_raw' => array(
@@ -831,6 +833,17 @@
         '#type' => 'checkbox',
         '#default_value' => $settings['export_csv'],
       );
+      $element['custom_class'] = array(
+        '#title' => t('Custom class'),
+        '#type' => 'textfield',
+        '#default_value' => $settings['custom_class'],
+      );
+      $element['custom_attr'] = array(
+        '#title' => t('Custom attributs'),
+        '#type' => 'textfield',
+        '#default_value' => $settings['custom_attr'],
+        "#description" =>'Exemple: cellspacing="0" width="100%" role="grid" aria-describedby="example_info" '
+      );
   }
   return $element;
 }
@@ -1184,6 +1197,8 @@
                 '#field_name' => $field['field_name'],
                 '#langcode' => $langcode,
                 '#formatter' => $formatter,
+                '#custom_class'=> isset($settings['custom_class']) ? $settings['custom_class'] : NULL,
+                '#custom_attr'=> isset($settings['custom_attr']) ? $settings['custom_attr'] : NULL
               );
             }
           }
@@ -1893,6 +1908,8 @@
         'sticky' => NULL,
         'striping' => NULL,
         'sortable' => NULL,
+        'custom_class' => NULL,
+        'custom_attr' => NULL,
         'attributes' => array(),
       ),
     ),
@@ -1921,8 +1938,14 @@
   $cols_class = isset($variables['header']) ? 'tablefield-columns-' . count($variables['header']) : NULL;
   $attributes = array(
     'id' => 'tablefield-' . $id,
-    'class' => array('tablefield', $sortable, $cols_class),
+    'class' => array('tablefield', $sortable, $cols_class,!empty($variables['custom_class'])?$variables['custom_class']:''),
   );
+  if(!empty($variables['custom_attr'])){
+    $custom_attr = str_replace(['" ',"' "], ['"&',"'&"], $variables['custom_attr']);
+    $custom_attr = str_replace(['"',"'"], '', $custom_attr);
+    parse_str($custom_attr,$arr_attr);
+    $attributes = array_merge($attributes,$arr_attr);
+  }
 
   // Apply scope property to headers for accessibility.
   if (is_array($variables['header'])) {
