The Guts of the issue!

The theming function itself for the view. I've tried to comment it to make reading it easier, however what it essentially does is overwrites portions of the view completely. The header section is a great example. I've reset $header to an array, thus it's empty. Then I go through and start setting it to whatever I please. This is rather powerful as in this case I have an elapsed time field I want in my view, but it's not pulled from the node, it's generated based on values in the node, and because of that I need it to be dynamic. When I initially tried this I tried CCK Calc, and that just simply didn't works since it's set at the time of the node's save. I've not tried views calc, I needed coloring anyway, and chose to solve that problem first, which solved both problems at once.

<?php

function garland_views_view_table_date($view, $nodes, $type) {
 
// Add headers
  // We are hard coding it, and that's ok.
  // It's about 2,000,000,000 times harder (not really)
  // to not hard code it :(
 
$header = array(
    array(
     
'data' => 'Title:',
     
'class' => 'title',
    ),
    array(
     
'data' => 'Start:',
     
'class' => 'start',
    ),
    array(
     
'data' => 'Due:',
     
'class' => 'due',
    ),
    array(
     
'data' => 'Done:',
     
'class' => 'done',
    ),
    array(
     
'data' => 'Elapsed:',
     
'class' => 'elapsed',
    ),
  );
 
$fields = _views_get_fields();

  foreach (
$nodes as $node) {
   
// If you're looking for good docs on what these things are called, good luck...
    // however if you print_r($nodes) at the beginning of this function, you'll
    // get some great information. 
   
    // reset $row
   
$row = array();
   
   
// Loop over each name
   
foreach ($view->field as $field) {
     
// Check to make sure it's visible
     
if ($fields[$field['id']]['visible'] !== FALSE) {
       
// The populate_row_by_cell function does essentially the same
        // thing we did to headers up top for us auto-magically, but with rows.
        // Let's format this on a per-case basis
        // Since this is being done via cases, you could potentially set
        // up a bunch of different styling options on a per case basis
        // that makes this code more flexible than just doing simple table layouts,
        // but I'll let you play with that.
       
switch ($field['field']) {
          case
'field_end_date_value':
           
populate_row_by_cell('due', $cell, $row, $fields, $field, $node, $view, FALSE);
            break;
          case
'field_start_date_value':
           
populate_row_by_cell('start', $cell, $row, $fields, $field, $node, $view, FALSE);
            break;
          case
'title':
           
populate_row_by_cell('task', $cell, $row, $fields, $field, $node, $view, FALSE);
            break;
          case
'field_completed_value':
           
populate_row_by_cell('completion', $cell, $row, $fields, $field, $node, $view, FALSE);
            break; 
        }
      }
    }

   
// The cases are all finished now, but I still want an extra
    // table cell that contains my % of elapsed time.
   
$due = $node->node_data_field_end_date_field_end_date_value;
   
$start = $node->node_data_field_start_date_field_start_date_value;
   
$data = elapsed_time($due, $start);
   
$row[] = array(
     
'data' => $data,
     
'class' => 'elapsed',
    );   
   
// Fetch the proper clas for the table row
   
$complete = $node->node_data_field_completed_field_completed_value;
   
$class = tr_class($data, $complete);
   
   
// Add this cell to the rows
   
$rows[] = array(
     
'data' => $row,
     
'class' => $class
   
);
  }
  return
theme('table', $header, $rows, array('class' => 'show-table'));
}

?>