Skip to main content

sourceNote: a footnote under the table

AFC, 2024
TeamPFPA
385326
402301
425311
309434
525368
345364
338404
289417
Data: nflverse
import { STANDINGS, type Standing } from "@sportsdataverse/examples/data";
import { defineTable } from "@sportsdataverse/sdvtables";
import { renderHTMLAsync } from "@sportsdataverse/sdvtables/html";

// The note is escaped unless you mark it unsafe (then it is inserted as HTML: only for markup you wrote).
const spec = defineTable<Standing>()
.columns((c) => [
c.logo("team", { league: "nfl" }),
c.int("pf", { label: "PF" }),
c.int("pa", { label: "PA" }),
])
.title("AFC, 2024")
.sourceNote('Data: <a href="https://nflverse.nflverse.com">nflverse</a>', { unsafe: true })
.build();
await renderHTMLAsync(spec, STANDINGS);

Tags: decoration · sourceNote. All sdvtables examples.