Fixed colspan

pull/187/head
M66B 5 years ago
parent fc7cf6e9d6
commit 22f5eded5d

@ -859,7 +859,7 @@ public class HtmlHelper {
cols++; cols++;
if (!"td".equals(col.tagName()) && !"th".equals(col.tagName())) { if (!"td".equals(col.tagName()) && !"th".equals(col.tagName())) {
Log.w("Column expected tag=" + col.tagName()); Log.e("Column expected tag=" + col.tagName());
if (tdebug) { if (tdebug) {
col.prependText("COLUMN=" + col.tagName() + "["); col.prependText("COLUMN=" + col.tagName() + "[");
col.appendText("]"); col.appendText("]");
@ -871,18 +871,16 @@ public class HtmlHelper {
if (!TextUtils.isEmpty(span)) if (!TextUtils.isEmpty(span))
try { try {
int colspan = Integer.parseInt(span); int colspan = Integer.parseInt(span);
if (colspan > 1) { if (colspan > 1)
if (tdebug)
col.prependText("SPAN=" + colspan);
for (int s = 1; s < colspan; s++) { for (int s = 1; s < colspan; s++) {
cols++; cols++;
Element clone = col.clone(); Element fill = document.createElement("td");
clone.children().remove(); for (Attribute attr : col.attributes())
fill.attr(attr.getKey(), attr.getValue());
if (tdebug) if (tdebug)
clone.prependText("(" + s + ")"); fill.prependText("(" + cols + "+" + s + "/" + (colspan - 1) + ")");
clone.append("&nbsp;"); fill.append("&emsp;");
col.after(clone); col.after(fill);
}
} }
} catch (NumberFormatException ex) { } catch (NumberFormatException ex) {
Log.w(ex); Log.w(ex);

Loading…
Cancel
Save