Skip to main content

composePage: the title and notes frame around any HTML

Points for and against

AFC, 2024 regular season

TeamPoints forPoints against
KC385326
LAC402301
DEN425311
LV309434
BUF525368
MIA345364
NYJ338404
NE289417

Buffalo scored the most points of these eight teams, New England the fewest

Source: nflverse

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.