On 06/30/2016 02:24 AM, Scott Kostyshak wrote:
On Thu, Jun 30, 2016 at 12:05:18AM -0400, Richard Heck wrote:
Try this:
--- src/insets/InsetTabular.cpp
+++ src/insets/InsetTabular.cpp
@@ -2989,17 +2989,20 @@ docstring Tabular::xhtmlRow(XHTMLStream & xs,
row_type row,
xs << html::StartTag("tr");
for (col_type c = 0; c < ncols(); ++c) {
+ bool didone = false;
if (isPartOfMultiColumn(row, c) || isPartOfMultiRow(row, c))
continue;
stringstream attr;
Length const cwidth = column_info[c].p_width;
- if (!cwidth.zero()) {
+ if (!didone && !cwidth.zero()) {
string const hwidth = cwidth.asHTMLString();
attr << "style =\"width: " << hwidth << ";\" ";
}
+ didone = true;
+
attr << "align='";
switch (getAlignment(cell)) {
case LYX_ALIGN_LEFT:
If it works, go ahead and put it in.
Richard
That doesn't work because the function is called for each row so didone
is initialized to false for each row. If the inner loop were over rows
then I think it would work (but would need to be outside of the loop).
We could do something like:
diff --git a/src/insets/InsetTabular.cpp b/src/insets/InsetTabular.cpp
index 7804232..5b76455 100644
--- a/src/insets/InsetTabular.cpp
+++ b/src/insets/InsetTabular.cpp
@@ -2995,7 +2995,7 @@ docstring Tabular::xhtmlRow(XHTMLStream & xs, row_type
row,
stringstream attr;
Length const cwidth = column_info[c].p_width;
- if (!cwidth.zero()) {
+ if (!cwidth.zero() && row == 0) {
string const hwidth = cwidth.asHTMLString();
attr << "style =\"width: " << hwidth << ";\" ";
}
If you like that then put it in, but perhaps it is just better to stick
with your original commit. I have no idea how this would work with e.g.
multicolumns. Your call.
I thought of this, too, but I worried that it would not work properly
with multicolumns.
Maybe better to stick with the original.
Richard