- for (col_type col = 0; col < ncols(); ++col)
- os << MTag("mtd") << cell(index(row, col)) << ETag("mtd");
+ for (col_type col = 0; col < ncols(); ++col) {
+ idx_type const i = index(row, col);
+ if (cellinfo_[i].multi_ != CELL_PART_OF_MULTICOLUMN) {
+ col_type const cellcols = ncellcols(i);
+ ostringstream attr;
+ if (cellcols > 1)
+ attr << "columnspan='" << cellcols << '\'';
+ os << MTag("mtd", attr.str()) << cell(i) << ETag("mtd");
+ }
+ }