Skip to main content
100%

Simple tables in D3

✓ Published0🌍 Public
Ssreeanthrds
Last edited Apr 18, 2020
Created on Apr 17, 2020
Forked from Untitled

This example demonstrates how to build a static HTML table using D3’s data-join pattern. It renders ten movie records—including title, year, length, budget, and rating—as table rows with formatted numbers, using `d3.format` for currency and one-decimal ratings, and a custom function for length as hours:minutes. The code constructs the table by appending `thead` and `tbody` elements, binding column definitions and row data via `selectAll` and `.data().enter()`, and applies CSS classes from the column definitions for alignment. The visualization relies on D3 v5 and the d3-jetpack helper library, with the data hardcoded in the script rather than loaded from a CSV.

AI-generated description

A bare minimum HTML page.

See also React Starter.

MIT Licensed

Similar vizzes