Make negative side margins zero on tables in the overflow wrapper. Fixes #4266.

This commit is contained in:
Brent Simmons committed 2026-07-26 10:46:04 -07:00
1 parent f8126db102
commit eab6a596e6
1 file changed
+9
+9
View File
@@ -64,6 +64,15 @@ function wrapTables() {
wrapper.className = "nnw-overflow";
table.parentNode.insertBefore(wrapper, table);
wrapper.appendChild(table);
// A negative side margin — usually from the site's own page layout —
// would put part of the table where the wrapper can't scroll to it.
if (parseFloat(getComputedStyle(table).marginLeft) < 0) {
table.style.marginLeft = "0";
}
if (parseFloat(getComputedStyle(table).marginRight) < 0) {
table.style.marginRight = "0";
}
}
}