- docstring ret;
-
- // Some tables are inline. Likely limitation: cannot output a table within a table; is that really a limitation?
- if (!runparams.docbook_in_table) { // Check on the *outer* set of parameters, so that the table can be closed
- // properly at the end of this function.
- xs << xml::StartTag("informaltable");
- xs << xml::CR();
- }
-
- // "Formal" tables have a title and use the tag <table>; the distinction with <informaltable> is done outside.
- // HTML has the caption first with titles forbidden, and CALS has a title first.
- if (haveLTCaption()) {
- std::string tag = ((buffer().params().docbook_table_output) == BufferParams::HTMLTable) ? "caption" : "title";
-
- xs << xml::StartTag(tag);
- for (row_type r = 0; r < nrows(); ++r)
- if (row_info[r].caption)
- docbookRow(xs, r, runparams);
- xs << xml::EndTag(tag);
- xs << xml::CR();
- }
-
- // CALS header: describe all columns in this table. For names, take 'c' then the ID of the column.
- // Start at one, as is customary with CALS!
- if (buffer().params().docbook_table_output == BufferParams::CALSTable) {
- for (col_type c = 0; c < ncols(); ++c) {
- std::stringstream attr;
- attr << "colnum='" << (c + 1) << "' ";
- attr << "colname='c" << (c + 1) << "' ";
- Length const cwidth = column_info[c].p_width;
- if (!cwidth.zero())
- attr << "colwidth='" << cwidth.asHTMLString() << "' ";
- attr << "rowheader='norowheader'"; // Last attribute, hence no space at the end.
-
- xs << xml::CompTag("colspec", attr.str());
- xs << xml::CR();
- }
- }
-