Prevent alignment of table contents

pull/187/head
M66B 4 years ago
parent f3b2231180
commit 6eadf1e183

@ -811,11 +811,13 @@ public class HtmlHelper {
document.select("caption").tagName("div"); document.select("caption").tagName("div");
for (Element table : document.select("table")) for (Element table : document.select("table")) {
table.attr("x-table", "true");
if (table.parent() != null && "a".equals(table.parent().tagName())) if (table.parent() != null && "a".equals(table.parent().tagName()))
table.tagName("span"); // Links cannot contain tables table.tagName("span"); // Links cannot contain tables
else else
table.tagName("div"); table.tagName("div");
}
for (Element hf : document.select("thead,tfoot")) for (Element hf : document.select("thead,tfoot"))
hf.tagName("span"); hf.tagName("span");
@ -2032,7 +2034,8 @@ public class HtmlHelper {
boolean table = false; boolean table = false;
Element e = element; Element e = element;
while (e != null) { while (e != null) {
if ("table".equals(e.tagName())) { if ("table".equals(e.tagName()) ||
"true".equals(e.attr("x-table"))) {
table = true; table = true;
break; break;
} }

Loading…
Cancel
Save