diff --git tablegroup.info tablegroup.info
index 862ac69..acca0a3 100644
--- tablegroup.info
+++ tablegroup.info
@@ -1,4 +1,6 @@
 name = Views Table Group
 description = Views style plugin to display Views results as cells in a table, grouping by row and column.
 package = Views
-core = 6.x
+core = 7.x
+files[] = tablegroup.views.inc
+files[] = tablegroup_plugin_style_tablegroup.inc
\ No newline at end of file
diff --git tablegroup.module tablegroup.module
index e64d93b..df017bb 100644
--- tablegroup.module
+++ tablegroup.module
@@ -15,11 +15,11 @@ function tablegroup_views_api() {
 function tablegroup_theme() {
   return array(
     'tablegroup_item' => array(
-      'arguments' => array('item' => NULL),
+      'variables' => array('item' => NULL),
     ),
   );
 }
 
-function theme_tablegroup_item($item) {
-  return '<div class="tablegroup-item">' . $item . '</div>';
+function theme_tablegroup_item($variables) {
+  return '<div class="tablegroup-item">' . $variables['item'] . '</div>';
 }
diff --git tablegroup.views.inc tablegroup.views.inc
index a38f8a5..ba03f63 100644
--- tablegroup.views.inc
+++ tablegroup.views.inc
@@ -30,5 +30,9 @@ function template_preprocess_tablegroup_view_tablegroup(&$variables) {
     array_unshift($rows[$row_label], array('header' => TRUE, 'data' => $row_label));
   }
 
-  $variables['table'] = theme('table', $header, $rows, array('class' => 'views-plugin-style-tablegroup'));
+  $variables['table'] = theme('table', array(
+                                            'header' => $header,
+                                            'rows' => $rows,
+                                            'attributes' => array('class' => array('views-plugin-style-tablegroup'))));
+
 }
diff --git tablegroup_plugin_style_tablegroup.inc tablegroup_plugin_style_tablegroup.inc
index 298f9d5..3267f9d 100644
--- tablegroup_plugin_style_tablegroup.inc
+++ tablegroup_plugin_style_tablegroup.inc
@@ -1,7 +1,9 @@
 <?php
 
-class tablegroup_plugin_style_tablegroup extends views_plugin_style {
-  function option_definition() {
+class tablegroup_plugin_style_tablegroup extends views_plugin_style
+{
+  function option_definition()
+  {
     $options = parent::option_definition();
 
     $options['row_grouping'] = array('default' => NULL);
@@ -9,12 +11,15 @@ class tablegroup_plugin_style_tablegroup extends views_plugin_style {
     $options['col_grouping'] = array('default' => NULL);
     $options['col_sort'] = array('default' => 0);
 
+    $options['cell_placeholder'] = array('default' => '&nbsp;');
+
     return $options;
   }
 
-  function options_form(&$form, &$form_state) {
+  function options_form(&$form, &$form_state)
+  {
     parent::options_form($form, $form_state);
-    
+
     // grabbed from views_plugin_style_table, slight edits {{{
     $handlers = $this->display->handler->get_handlers('field');
     if (empty($handlers)) {
@@ -61,16 +66,25 @@ class tablegroup_plugin_style_tablegroup extends views_plugin_style {
       '#options' => array(0 => 'none', 'asc' => 'asc', 'desc' => 'desc'),
       '#default_value' => $this->options['col_sort'],
     );
+
+    $form['cell_placeholder'] = array(
+      '#type' => 'textfield',
+      '#title' => t('Cell placeholder'),
+      '#default_value' => $this->options['cell_placeholder'],
+    );
   }
 
-  function render() {
+  function render()
+  {
     $output = '';
 
     // Figure out what functions to use for sorting rows and columns.
     // @see http://php.net/asort
     // @see http://php.net/ksort
-    $col_sort = ($this->options['col_sort'] == 'asc' ? 'asort' : ($this->options['col_sort'] == 'desc' ? 'arsort' : ''));
-    $row_sort = ($this->options['row_sort'] == 'asc' ? 'ksort' : ($this->options['row_sort'] == 'desc' ? 'krsort' : ''));
+    $col_sort = ($this->options['col_sort'] == 'asc' ? 'asort' : ($this->options['col_sort'] == 'desc' ? 'arsort'
+      : ''));
+    $row_sort = ($this->options['row_sort'] == 'asc' ? 'ksort' : ($this->options['row_sort'] == 'desc' ? 'krsort'
+      : ''));
 
     // Group the rows according to the grouping field, if specified.
     $sets = $this->render_grouping($this->view->result, $this->options['grouping']);
@@ -83,53 +97,63 @@ class tablegroup_plugin_style_tablegroup extends views_plugin_style {
       // group by row
       $rows = $this->render_grouping($set, $this->options['row_grouping']);
 
-        foreach ($rows as $row_header => $row) {
-          // group by column
-          $columns = $this->render_grouping($row, $this->options['col_grouping']);
-          $table['raw'][$row_header] = $columns;
+      foreach ($rows as $row_header => $row) {
+        // group by column
+        $columns = $this->render_grouping($row, $this->options['col_grouping']);
 
-          // collect the column headers
-          foreach (array_keys($columns) as $col_header) {
-            if (!in_array($col_header, $table['header'])) {
-              $table['header'][] = $col_header;
-            }
+        $table['raw'][$row_header] = $columns;
+
+        // collect the column headers
+        foreach (array_keys($columns) as $col_header) {
+          if (!in_array($col_header, $table['header'])) {
+            $table['header'][] = $col_header;
           }
         }
+      }
 
-        // Order rows and columns.
-        if ($col_sort) { $col_sort($table['header']); }
-        if ($row_sort) { $row_sort($table['raw']); }
-
-        // step through and fill each cell
-        foreach (array_keys($table['raw']) as $row_header) {
-          foreach ($table['header'] as $col_header) {
-            // if there are items in this cell, render them
-            if (isset($table['raw'][$row_header][$col_header])) {
-              foreach ($table['raw'][$row_header][$col_header] as $row_index => $item) {
-                // the view's row_index property is used by template_preprocess_views_view_fields()
-                // in Views' theme.inc to match figure out which view result is
-                // being rendered (despite the fact that we are passing in the
-                // object we want rendered!!)
-                $this->view->row_index = $row_index;
-                $table['rows'][$row_header][$col_header] .= theme('tablegroup_item', $this->row_plugin->render($item));
-              }
+      // Order rows and columns.
+      if ($col_sort) {
+        $col_sort($table['header']);
+      }
+      if ($row_sort) {
+        $row_sort($table['raw']);
+      }
+
+      foreach (array_keys($table['raw']) as $row_header) {
+        foreach ($table['header'] as $col_header) {
+          // if there are items in this cell, render them
+          if (isset($table['raw'][$row_header][$col_header])) {
+            foreach ($table['raw'][$row_header][$col_header] as $row_index => $item) {
+              // the view's row_index property is used by template_preprocess_views_view_fields()
+              // in Views' theme.inc to match figure out which view result is
+              // being rendered (despite the fact that we are passing in the
+              // object we want rendered!!)
+              $this->view->row_index = $row_index;
+              $table['rows'][$row_header][$col_header] .= theme('tablegroup_item', array('item' => $this->row_plugin->render($item)));
             }
+          }
             // empty cell, use a placeholder
-            else {
-              $table['rows'][$row_header][$col_header] = '&nbsp;';
-            }
+          else {
+            $table['rows'][$row_header][$col_header] = filter_xss_admin($this->options['cell_placeholder']);
           }
         }
+      }
 
-      // finally, render using the theme function
-      $output .= theme($this->theme_functions(), $this->view, $this->options, $table, $title);
+      $output .= theme($this->theme_functions(),
+        array(
+          'view' => $this->view,
+          'options' => $this->options,
+          'rows' => $table,
+          'title' => $title)
+        );
     }
 
     unset($this->view->row_index);
     return $output;
   }
 
-  function validate() {
+  function validate()
+  {
     $errors = parent::validate();
 
     if (!isset($this->options['row_grouping']) || !isset($this->options['col_grouping'])) {
