Skip to main content

The sample rows every table example uses

STANDINGS: eight AFC teams, 2024 regular season
teamconfdivisionwinslossestiespfpanet_epasrs_rankqbqb_espn_idresult_last
KCAFCWest15203853260.06310Patrick Mahomes3139477L
LACAFCWest11604023010.1019Justin Herbert4038941W
DENAFCWest10704253110.1088Bo Nix4426338W
LVAFCWest4130309434-0.14626Gardner Minshew4038524L
BUFAFCEast13405253680.194Josh Allen3918298L
MIAAFCEast890345364-0.01921Tua Tagovailoa4241479L
NYJAFCEast5120338404-0.04524Aaron Rodgers8439W
NEAFCEast413028941729Drake Maye4431452W
import { STANDINGS } from "@sportsdataverse/examples/data"
import { STANDINGS, type Standing } from "@sportsdataverse/examples/data";
import { defineTable } from "@sportsdataverse/sdvtables";
import { renderHTMLAsync } from "@sportsdataverse/sdvtables/html";

// One text column per field, labelled with the field name, so the page shows the rows exactly as stored.
const fields = Object.keys(STANDINGS[0] ?? {}) as (keyof Standing)[];
const spec = defineTable<Standing>()
.columns((c) => fields.map((k) => c.text(k, { label: k })))
.title("STANDINGS: eight AFC teams, 2024 regular season")
.sourceNote('import { STANDINGS } from "@sportsdataverse/examples/data"')
.build();
await renderHTMLAsync(spec, STANDINGS);

Tags: table · STANDINGS · sample data · nfl. All sdvtables examples.