You're best bet is to render the table by rows, and then use javascript to invert the table
http://jsfiddle.net/CsgK9/2/
The following code will invert a table (this sample code uses jquery)
$("table").each(function() {
var $this = $(this);
var newrows = [];
$this.find("tr").each(function(){
var i = 0;
$(this).find("td").each(function(){
i++;
if(newrows[i] === undefined) { newrows[i] = $(""); }
newrows[i].append($(this));
});
});
$this.find("tr").remove();
$.each(newrows, function(){
$this.append(this);
});
});
UPDATE:
Here is a version that works with th elements as well:
http://jsfiddle.net/zwdLj/