Index: trunk/ippMonitor/scripts/generate
===================================================================
--- trunk/ippMonitor/scripts/generate	(revision 18143)
+++ trunk/ippMonitor/scripts/generate	(revision 18193)
@@ -228,15 +228,25 @@
 sub write_table_header {
 
-    # add column sorting elements here
+    # print the table header (field labels)
+    print FILE "echo \"<tr><td></td>\\n\";\n"; 
     for ($i = 0; $i < @field; $i++) {
 	($label, $value, $string) = &parse_label ($show[$i]);
 	if ($show[$i] eq "none")  { next; }
-	# print FILE "echo \"<th class=\\\"list\\\"> $name[$i] </th>\\n\";\n";
+	print FILE "write_header_cell (\"list\", \"$name[$i]\");\n";
+    }
+    print FILE "echo \"</tr>\\n\";\n";
+
+    # print the column sort cells
+    print FILE "echo \"<tr><td></td>\\n\";\n"; 
+    for ($i = 0; $i < @field; $i++) {
+	($label, $value, $string) = &parse_label ($show[$i]);
+	if ($show[$i] eq "none")  { next; }
 	if ($label eq "op") {
-	    print FILE "write_table_header (\"list\", \"$name[$i]\", \"$opf{$value}\", \$buttonLink, \$ID, '$myFile');\n";
+	    print FILE "write_sort_cell (\"list\", \"$opf{$value}\", \$buttonLink, \$ID, '$myFile');\n";
 	} else {
-	    print FILE "write_table_header (\"list\", \"$name[$i]\", \"$field[$i]\", \$buttonLink, \$ID, '$myFile');\n";
-	}
-    }
+	    print FILE "write_sort_cell (\"list\", \"$field[$i]\", \$buttonLink, \$ID, '$myFile');\n";
+	}
+    }
+    print FILE "echo \"</tr>\\n\";\n";
 }
 
@@ -248,9 +258,14 @@
 
 	# TD_CLASS class field expression
-	($class, $field, $testline) = split (" ", $tdClass, 3);
-
-	$field = &parse_fieldname ($field);
-
-	print FILE "  if ($field $testline) {\n";
+	($class, $testline) = split (" ", $tdClass, 2);
+
+	$testlineFixed = "";
+	@testlineBits = split (" ", $testline);
+	foreach my $bit (@testlineBits) {
+	    $newbit = &parse_fieldname ($bit);
+	    $testlineFixed = "$testlineFixed $newbit";
+	}
+
+	print FILE "  if ($testlineFixed) {\n";
 	print FILE "    \$class = \"$class\";\n";
 	print FILE "  }\n";
@@ -270,4 +285,5 @@
 	    print FILE "\$WHERE = check_restrict ('$value', \$WHERE, 'string');\n";
 	} else {
+	    print FILE "\$WHERE = check_restrict ('$value', \$WHERE, 'string');\n";
 	    print FILE "\$WHERE = check_restrict ('$value', \$WHERE, 'min');\n";
 	    print FILE "\$WHERE = check_restrict ('$value', \$WHERE, 'max');\n";
@@ -286,4 +302,5 @@
 	    print FILE "\$buttonLink = button_restrict_string ('$value', \$buttonLink);\n";
 	} else {
+	    print FILE "\$buttonLink = button_restrict_string ('$value', \$buttonLink);\n";
 	    print FILE "\$buttonLink = button_restrict_min ('$value', \$buttonLink);\n";
 	    print FILE "\$buttonLink = button_restrict_max ('$value', \$buttonLink);\n";
@@ -297,5 +314,5 @@
     my ($i);
 
-    print FILE "echo \"<tr>\\n\";\n";
+    print FILE "echo \"<tr><td>&ge</td>\\n\";\n";
     for ($i = 0; $i < @field; $i++) {
 	if ($show[$i] eq "none")  { next; }
@@ -311,5 +328,5 @@
 	}
     }
-    print FILE "echo \"</tr> <tr>\\n\";\n";
+    print FILE "echo \"</tr><tr><td>&le</td>\\n\";\n";
     for ($i = 0; $i < @field; $i++) {
 	if ($show[$i] eq "none")  { next; }
@@ -347,4 +364,10 @@
 	    # print the actual table cell line with the link...
 	    if (! $value && ($field[$i] ne "*")) { $value = "\$row[$Nrow]"; }
+
+	    # add special format elements
+	    # $realFormat = $format[$i];
+	    # if ($format[$i] eq '%T') {
+	    # 	$realFormat = '%s';
+	    # }
 	    print FILE "  write_table_cell (\$class, '$format[$i]', $myLink, $value);\n";
 	    next;
@@ -557,4 +580,5 @@
     foreach $word (@words) {
 	$fword = &parse_fieldname ($word);
+	# print "field: $word -> $fword\n";
 	push @outwords, $fword;
 	if ($word =~ m|^\$|) {
