The solution is (of course) to insert table headers with the DOM-class in GWT.
Now the number of rows, clear etc works fine. FlexTable uses "correct". The camel back IE "feature" took me a while though.
/**
* Initializes the table with header rows. The headers are defined by the headerModel
* This adds the header rows directly to the table, using the DOM-class. The current FlexTable implemenetation
* doesn't have headers. This uses the normal html ... syntax
*/
private void initTable() {
Element thead = DOM.createTHead();
DOM.insertChild(table.getElement(), thead, 0);
for (int row = 0; row <>
Element tr = DOM.createTR();
DOM.appendChild(thead, tr);
for (int col = 0; col <>
Element th = DOM.createTH();
DOM.appendChild(tr, th);
// NB!!!! camelback on attributes for IE or despair
DOM.setElementAttribute(th, "colSpan", String.valueOf(headerModel.getHeaderSpan(row, col)));
DOM.setElementAttribute(th, "align", "left");
DOM.setElementAttribute(th, "border", "1");
//set header text
DOM.setInnerText(th, headerModel.getHeaderText(row, col));
}
}
}