]> git.lyx.org Git - lyx.git/blobdiff - src/insets/InsetTabular.cpp
Minor corrections and elaborations
[lyx.git] / src / insets / InsetTabular.cpp
index 265a0165f8afd61d98bd8ef06bcb3391c7bb6810..163f162aa733c0b98e0d211d3855c2d6fcf89a36 100644 (file)
@@ -3677,7 +3677,7 @@ std::string Tabular::getHAlignAsCssAttribute(idx_type cell) const
                // experimental.
                // https://www.w3.org/TR/css-text-4/#character-alignment
                Language const *lang = buffer().paragraphs().front().getParLanguage(buffer().params());
-               return "text-align: '" + to_utf8(lang->decimalSeparator()) + "'";
+               return "text-align: \"" + to_utf8(lang->decimalSeparator()) + "\"";
        }
        default:
                return "text-align: center";
@@ -3798,7 +3798,7 @@ docstring Tabular::xmlRow(XMLStream & xs, const row_type row, OutputParams const
                if (output_format == XmlOutputFormat::XHTML) {
                        // In HTML5, prefer to use CSS instead of attributes for alignment
                        // (align and valign).
-                       style << getHAlignAsCssAttribute(cell) << " "
+                       style << getHAlignAsCssAttribute(cell) << "; "
                              << getVAlignAsCssAttribute(cell);
                } else {
                        // In DocBook, both for HTML and CALS tables, stick to attributes.
@@ -3825,9 +3825,11 @@ docstring Tabular::xmlRow(XMLStream & xs, const row_type row, OutputParams const
                if (is_xhtml_table) {
                        const std::vector<std::string> styles = computeCssStylePerCell(row, c, cell);
 
-                       std::string attr_str_prefix = "style='" ;
+                       std::string attr_str_prefix = "style='" + style.str();
+                       if (!styles.empty())
+                               attr_str_prefix += "; ";
                        for (auto it = styles.begin(); it != styles.end(); ++it) {
-                               attr << *it;
+                               attr_str_prefix += *it;
                                if (it != styles.end() - 1)
                                        attr_str_prefix += "; ";
                        }