diff -urNp --strip-trailing-cr ./original_cck_table/cck_table.info ./cck_table/cck_table.info
--- ./original_cck_table/cck_table.info	2009-06-25 01:41:08.135827200 +1000
+++ ./cck_table/cck_table.info	2009-06-24 17:25:40.943974400 +1000
@@ -1,11 +1,10 @@
-; $Id: cck_table.info,v 1.1 2008/05/03 05:42:10 rszrama Exp $
+; $Id$
+; Convert from 5 to 6 by iStryker
+; sponser by www.themes247.com
 name = Table
-description = Defines a field type that outputs data in a table.
-dependencies = content
+description = Defines a cck field type that outputs data in a table.
+dependencies[] = content
 package = CCK
+core = 6.x
 
-; Information added by drupal.org packaging script on 2008-05-03
-version = "5.x-1.x-dev"
-project = "cck_table"
-datestamp = "1209816067"
 
diff -urNp --strip-trailing-cr ./original_cck_table/cck_table.install ./cck_table/cck_table.install
--- ./original_cck_table/cck_table.install	1970-01-01 10:00:00.000000000 +1000
+++ ./cck_table/cck_table.install	2009-06-24 17:15:26.750808000 +1000
@@ -0,0 +1,44 @@
+<?php
+// $Id$
+
+/**
+ *  Module coverted to 6 by iStryker
+ *  Sponser by Themes 24/7  http://www.themes247.com
+ */
+
+/**
+ * @file
+ * Implementation of hook_install().
+ */
+function cck_table_install() {
+  drupal_load('module', 'content');
+  content_notify('install', 'cck_table');
+}
+
+/**
+ * Implementation of hook_uninstall().
+ */
+function nodereference_uninstall() {
+  drupal_load('module', 'content');
+  content_notify('uninstall', 'cck_table');
+}
+
+/**
+ * Implementation of hook_enable().
+ *
+ * Notify content module when this module is enabled.
+ */
+function nodereference_enable() {
+  drupal_load('module', 'content');
+  content_notify('enable', 'cck_table');
+}
+
+/**
+ * Implementation of hook_disable().
+ *
+ * Notify content module when this module is disabled.
+ */
+function nodereference_disable() {
+  drupal_load('module', 'content');
+  content_notify('disable', 'cck_table');
+}
\ No newline at end of file
diff -urNp --strip-trailing-cr ./original_cck_table/cck_table.module ./cck_table/cck_table.module
--- ./original_cck_table/cck_table.module	2009-06-25 01:41:08.155856000 +1000
+++ ./cck_table/cck_table.module	2009-06-25 11:30:30.163728000 +1000
@@ -2,16 +2,42 @@
 // $Id: cck_table.module,v 1.1 2008/05/03 05:42:10 rszrama Exp $
 
 /**
+ *  Module version 5 create by rszrama
+ *  sponser by Wombats http://www.bywombats.com
+ *  Module coverted to 6 by iStryker
+ *  Sponser by Themes 24/7  http://www.themes247.com
+ */
+
+/**
  * @file
  * Defines a field type that outputs data in a table.
  */
 
 /**
+ * Implementation of hook_theme().
+ */
+function cck_table_theme() {
+  return array(
+    'cck_table_textarea' => array(
+      'arguments' => array('element' => NULL),
+      
+    ),
+    'cck_table_formatter_default' => array(
+      'arguments' => array('element' => NULL), 
+      'function' => 'theme_cck_table_formatter'),
+  );
+} 
+ 
+ 
+/**
  * Implementation of hook_field_info().
  */
 function cck_table_field_info() {
   return array(
-    'tablefield' => array('label' => t('Table')),
+    'tablefield' => array(
+      'label' => t('Table Field'),
+      'description' => t('Defines a textarea field that outputs data in a table'),
+    ),
   );
 }
 
@@ -35,20 +61,24 @@ function cck_table_field_settings($op, $
         '#description' => t('Specify a class to be added to the table element.'),
         '#default_value' => isset($field['css_class']) ? $field['css_class'] : '',
       );
+      $form['table_header'] = array(
+        '#type' => 'checkbox',
+        '#title' => t('Allow table header'),
+        '#description' => t('the first row of the textarea is the header by default.  If unchecked then there will be no header'),
+        '#default_value' => ($field['table_header'] == '1') ? '1' : '0',
+      );
       return $form;
-
+    
     case 'validate':
       break;
 
     case 'save':
-      return array('css_id', 'css_class');
+      return array('css_id', 'css_class', 'table_header');
 
     case 'database columns':
-      if ($field['type'] == 'tablefield') {
-        return array(
-          'value' => array('type' => 'text', 'not null' => FALSE, 'default' => NULL, 'sortable' => FALSE),
-        );
-      }
+        $columns['value'] = array('type' => 'text', 'not null' => FALSE, 'default' => NULL, 'sortable' => FALSE);
+        return $columns;
+      
 
     case 'filters':
       break;
@@ -56,6 +86,16 @@ function cck_table_field_settings($op, $
 }
 
 /**
+ * Implementation of hook_content_is_empty().
+ */
+function cck_table_content_is_empty($item, $field) {
+  if (empty($item['value']) && (string)$item['value'] !== '0') {
+    return TRUE;
+  }
+  return FALSE;
+}
+
+/**
  * Implementation of hook_field_formatter_info().
  */
 function cck_table_field_formatter_info() {
@@ -66,20 +106,35 @@ function cck_table_field_formatter_info(
     ),
   );
 }
+/**
+ * Implementation of hook_field().
+ */
+function cck_table_field($op, &$node, $field, &$items, $teaser, $page) {
+          
+  switch ($op) {
+    case 'load':
+      break;
+    case 'sanitize':
+      $items[0]['table_header'] = $field['table_header'];
+      break;
+  }
+}
 
+function theme_cck_table_formatter($element) {
 /**
  * Implementation of hook_field_formatter().
  */
-function cck_table_field_formatter($field, $item, $formatter, $node) {
-  if (!isset($item['value'])) {
+  if (!isset($element['#item']['value'])) {
     return '';
   }
-
-  switch ($formatter) {
+  //don't really need the switch but leave it in for now
+  switch ($element['#formatter']) {
     case 'default':
-      $data = $item['value'];
+      $data = $element['#item']['value'];
   }
-
+  $field_name = $element['#field_name'];
+  //$element['#node']['content'][$field_name]
+  $field = $element['#item'];
   if (!empty($data)) {
     $header = array();
     $rows = array();
@@ -90,7 +145,7 @@ function cck_table_field_formatter($fiel
 
     foreach ($lines as $line) {
       $cells = explode('|', $line);
-      if (count($header) == 0 && count($lines) > 1) {
+      if (count($header) == 0 && count($lines) > 1 && $element['#item']['table_header'] == 1) {
         $header = $cells;
       }
       else {
@@ -102,7 +157,7 @@ function cck_table_field_formatter($fiel
       $attributes = array();
 
       if (!empty($field['css_id'])) {
-        $attributes['id'] = $field['css_id'] .'-'. $node->nid;
+        $attributes['id'] = $field['css_id'] .'-'. $element['#node']['nid'];
       }
       if (!empty($field['css_class'])) {
         $attributes['class'] = $field['css_class'];
@@ -118,9 +173,13 @@ function cck_table_field_formatter($fiel
  */
 function cck_table_widget_info() {
   return array(
-    'table_textarea' => array(
+    'cck_table_textarea' => array(
       'label' => t('Textarea'),
       'field types' => array('tablefield'),
+      'multiple values' => CONTENT_HANDLE_CORE,
+      'callbacks' => array(
+        'default value' => CONTENT_CALLBACK_DEFAULT,
+      ),
     ),
   );
 }
@@ -132,54 +191,133 @@ function cck_table_widget_settings($op, 
   switch ($op) {
     case 'form':
       $form = array();
+      $rows = (isset($widget['rows']) && is_numeric($widget['rows'])) ? $widget['rows'] : 5;
       $form['rows'] = array(
         '#type' => 'textfield',
         '#title' => t('Rows'),
-        '#default_value' => $widget['rows'] ? $widget['rows'] : 5,
+        '#default_value' => $rows,
+        '#element_validate' => array('_element_validate_integer_positive'),
         '#required' => TRUE,
       );
       return $form;
-
-    case 'validate':
-      if (!is_numeric($widget['rows']) || intval($widget['rows']) != $widget['rows'] || $widget['rows'] <= 1) {
-        form_set_error('rows', t('"Rows" must be a positive integer greater than 1.'));
-      }
-      break;
-
+      
     case 'save':
       return array('rows');
   }
 }
 
 /**
- * Implementation of hook_widget().
+ * Implementation of FAPI hook_elements().
+ *
+ * Any FAPI callbacks needed for individual widgets can be declared here,
+ * and the element will be passed to those callbacks for processing.
+ *
+ * Drupal will automatically theme the element using a theme with
+ * the same name as the hook_elements key.
+ *
+ * Autocomplete_path is not used by text_widget but other widgets can use it
+ * (see nodereference and userreference).
  */
-function cck_table_widget($op, &$node, $field, &$items) {
-  switch ($op) {
-    case 'form':
-      $form = array();
-
-      $form[$field['field_name']] = array('#tree' => TRUE);
+function cck_table_elements() {
+  return array(
+    'cck_table_textarea' => array(
+      '#input' => TRUE,
+      '#columns' => array('value'), '#delta' => 0,
+      '#process' => array('textarea_process'),
+    ),
+  );
+}
 
-      $form[$field['field_name']][0]['value'] = array(
-        '#type' => 'textarea',
-        '#title' => t($field['widget']['label']),
-        '#default_value' => $items[0]['value'],
-        '#required' => $field['required'],
-        '#rows' => $field['widget']['rows'],
-        '#description' => t('Enter table cell data separated by |, one row per line. The first line contains the table header information.') .'<br />'. t($field['widget']['description']),
-        '#weight' => $field['widget']['weight'],
-      );
 
-      return $form;
+/**
+ * Implementation of hook_widget().
+ *
+ * Attach a single form element to the form. It will be built out and
+ * validated in the callback(s) listed in hook_elements. We build it
+ * out in the callbacks rather than here in hook_widget so it can be
+ * plugged into any module that can provide it with valid
+ * $field information.
+ *
+ * Content module will set the weight, field name and delta values
+ * for each form element. This is a change from earlier CCK versions
+ * where the widget managed its own multiple values.
+ *
+ * If there are multiple values for this field, the content module will
+ * call this function as many times as needed.
+ *
+ * @param $form
+ *   the entire form array, $form['#node'] holds node information
+ * @param $form_state
+ *   the form_state, $form_state['values'][$field['field_name']]
+ *   holds the field's form values.
+ * @param $field
+ *   the field array
+ * @param $items
+ *   array of default values for this field
+ * @param $delta
+ *   the order of this item in the array of subelements (0, 1, 2, etc)
+ *
+ * @return
+ *   the form item for a single element for this field
+ */
+function cck_table_widget(&$form, &$form_state, $field, $items, $delta = 0) {
+  $element = array(
+    '#type' => $field['widget']['type'],
+    '#default_value' => isset($items[$delta]) ? $items[$delta] : '',
+  );
+  return $element;
+}
 
-    case 'process form values':
-      // Don't save empty fields except the first value
-      foreach ($items as $delta => $item) {
-        if ($item['value'] == '' && $delta > 0) {
-          unset($items[$delta]);
-        }
-      }
-      break;
+function textarea_process($element, $edit, $form_state, $form) {
+  $field = $form['#field_info'][$element['#field_name']];
+  $field_key = $element['#columns'][0];
+  $element[$field_key] = array(
+    '#type' => 'textarea',
+    '#default_value' => isset($element['#value'][$field_key]) ? $element['#value'][$field_key] : NULL,
+    '#rows' => !empty($field['widget']['rows']) ? $field['widget']['rows'] : 5,
+    '#weight' => 0,
+    
+    // The following values were set by the content module and need
+    // to be passed down to the nested element.
+    '#title' => $element['#title'],
+    '#required' => $element['#required'],
+    '#field_name' => $element['#field_name'],
+    '#type_name' => $element['#type_name'],
+    '#delta' => $element['#delta'],
+    '#columns' => $element['#columns'],   
+  );
+  //different description if first line can be the table header or not
+  if( $field['table_header'] == 1 ) {
+    $element[$field_key]['#description'] = t('Enter table cell data separated by |, one row per line. The first line contains the table header information.');
+  } else {
+    $element[$field_key]['#description'] = t('Enter table cell data separated by |, one row per line.');
   }
+ 
+  // Used so that hook_field('validate') knows where to flag an error.
+  $element['_error_element'] = array(
+    '#type' => 'value',
+    '#value' => implode('][', array_merge($element['#parents'], array($field_key))),
+  );
+  
+  //added feature, if you want node creater to be able to define table headers
+  $element['table_header'] = array(
+    '#type' => 'value',
+    '#value' => $field['table_header'],
+  );
+  return $element;
+}
+
+/**
+ * FAPI theme for an individual text elements.
+ *
+ * The textfield or textarea is already rendered by the
+ * textfield or textarea themes and the html output
+ * lives in $element['#children']. Override this theme to
+ * make custom changes to the output.
+ *
+ * $element['#field_name'] contains the field name
+ * $element['#delta]  is the position of this element in the group
+ */
+function theme_cck_table_textarea($element) {
+  return $element['#children'];
 }
\ No newline at end of file
