composePage: the title and notes frame around any HTML
Points for and against
AFC, 2024 regular season
| Team | Points for | Points against |
|---|---|---|
| KC | 385 | 326 |
| LAC | 402 | 301 |
| DEN | 425 | 311 |
| LV | 309 | 434 |
| BUF | 525 | 368 |
| MIA | 345 | 364 |
| NYJ | 338 | 404 |
| NE | 289 | 417 |
import { STANDINGS, type Standing } from "@sportsdataverse/examples/data";
import { defineTable } from "@sportsdataverse/sdvtables";
import { composePage } from "@sportsdataverse/sdvtables/export";
import { renderHTML } from "@sportsdataverse/sdvtables/html";
const spec = defineTable<Standing>()
.columns((c) => [
c.text("team"),
c.int("pf", { label: "Points for" }),
c.int("pa", { label: "Points against" }),
])
.theme("swiss")
.build();
// the frame gridTables and stackTables put around their tables, here around one table of your own
composePage(renderHTML(spec, STANDINGS), {
title: "Points for and against",
subtitle: "AFC, 2024 regular season",
caption: "Buffalo scored the most points of these eight teams, New England the fewest",
captionRule: true,
sourceNote: "Source: nflverse",
});
Tags: node · table · export · composePage · nfl. All sdvtables examples.