//The width can be the sum of the with of all the rows starting from the current one, up to the inner most one.
int auxWidth = 0;
boolean found = false;
for (Iterator iterator = djcross.getRows().iterator(); iterator.hasNext();) {
DJCrosstabRow row = (DJCrosstabRow) iterator.next();
if (!row.equals(crosstabRow) && found == false){
continue;
} else {
found = true;
}
auxWidth += row.getHeaderWidth();
}
element.setWidth(auxWidth);
applyCellBorder(totalHeaderContent);