Index: modules/contrib/tablefield/tablefield.module
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- modules/contrib/tablefield/tablefield.module	(revision d6b2ea5cc9ff7725b348de986a30cb0eb8e73c44)
+++ modules/contrib/tablefield/tablefield.module	(date 1518436010000)
@@ -521,6 +521,8 @@
         'trim_trailing_cols' => FALSE,
         'trim_trailing_rows' => FALSE,
         'export_csv' => FALSE,
+        'custom_class' => 'table',
+        'custom_attr' => '',
       ),
     ),
     'format_raw' => array(
@@ -795,6 +797,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;
 }
@@ -1144,6 +1157,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
             );
           }
         }
@@ -1832,6 +1847,8 @@
         'sticky' => NULL,
         'striping' => NULL,
         'sortable' => NULL,
+        'custom_class' => NULL,
+        'custom_attr' => NULL,
         'attributes' => array(),
       ),
     ),
@@ -1858,8 +1875,14 @@
   $sortable = $variables['sortable'] ? 'tablesorter' : NULL;
   $attributes = array(
     'id' => 'tablefield-' . $variables['delta'],
-    'class' => array('tablefield', $sortable),
+    'class' => array('tablefield', $sortable,$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'])) {
