Public
Edited
Apr 26, 2024
Insert cell
Insert cell
visibilityCollapseSupported = {
// create <table><tr style="visibility: collapse; height: 200px"><td></td></tr></table>
const table = document.createElement("table"),
tr = document.createElement("tr"),
td = document.createElement("td");
tr.style.height = "200px";
tr.style.visibility = "collapse";
table.appendChild(tr);
tr.appendChild(td);
// add it to the body to force layout
document.body.appendChild(table);
// check scroll height: Firefox mostly supports this at the time of writing
// but seems to have a bug of not contracting the scrollHeight.
const supported = table.scrollHeight == 0;
// Remove again from body so we can garbafe collect.
document.body.removeChild(table);
return supported;
}
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more