Published
Edited
Dec 12, 2019
1 star
Insert cell
md`# Understanding CSS Grid`
Insert cell
viewof height = html`<input type="range" value="5">`
Insert cell
viewof gap = html`<input type="range" value="5">`
Insert cell
viewof rows = html`<input type="range" value="5">`
Insert cell
rows
Insert cell
html`<div style="display: grid; grid-gap: ${gap}px; grid-template-columns: 1fr 1fr;">
${(() => {
let c = [];
for (let i = 0; i < rows; i++) c.push(i);
return c.map(i => `
<div style="background: red; height: ${height}px"></div>
<div style="background: green; height: ${height}px"></div>
`).join('\n');
})()}
</div>`
Insert cell

One platform to build and deploy the best data apps

Experiment and prototype by building visualizations in live JavaScript notebooks. Collaborate with your team and decide which concepts to build out.
Use Observable Framework to build data apps locally. Use data loaders to build in any language or library, including Python, SQL, and R.
Seamlessly deploy to Observable. Test before you ship, use automatic deploy-on-commit, and ensure your projects are always up-to-date.
Learn more