private String formatHistory(String history) {	  
	  String[] lines = history.split("\\r?\\n");
	  String[] fields;
	  
	  String result = "<table class=\"history\"><thead>";
	  
	  for (Integer i=0; i<lines.length; i++) {
		  String line = lines[i].trim();
		  
		  if (line.matches("(\\-+[\\s\\t]*\\|?[\\s\\t]*)+")) {
			  continue;
		  }
		  
		  fields = line.split("\\|");
		  result += "<tr>";
		  
		  for (Integer j=0; j<fields.length; j++) {
			  String field = fields[j].trim();
			  
			  if (field.equals("Date") || field.equals("Author") || field.equals("Version")) {
				  result += ("<th>"+field+"</th>");
				  continue;
			  } else if (field.equals("Remarks")) {
				  result += ("<th class=\"remarks\">"+field+"</th>");
				  continue;
			  }
			  
			  if (result.endsWith("</th>")) {
				  result += "</tr></thead><tbody>";
			  }
			  
			  result += "<td>"+field+"</td>";
		  }
		  
		  result += "</tr>";
	  }
	  
	  result += "</tbody></table>";
	  
	  return result;
  }