void Director::build_table(std::ostringstream& ss, Entries entries, const std::string& path) { ss << "<table class=\"table table-hover\">"; ss << "<thead>"; add_table_header(ss); ss << "</thead>"; ss << "<tbody>"; for(auto e : *entries) { add_tr(ss, path, e); } ss << "</tbody>"; ss << "</table>"; }
QString pdfgentor::to_html(const QTableView *res, int line_per_page) { int row_nr = res->verticalHeader()->count(); int col_nr = res->horizontalHeader()->count(); QString buf = "<table border=3 bgcolor=black width=100\% heigh=100\% colspan=5 align=center>"; for (int y = 0; y < row_nr; y++) { if (! (y % line_per_page)) add_table_header(res, &buf, col_nr); buf += "<tr>"; for (int x = 0; x < col_nr; x++) buf += "<td><font color=yellow>" + res->model()->index(y, x).data().toString() + "</font></td>"; buf += "</tr>"; } buf += "</table>"; return buf; }