Skip to main content

wrapLabels: long column labels on several lines

AFC, 2024
TeamPoints
scored,
regular
season
Points
allowed,
regular
season
385326
402301
425311
309434
525368
345364
338404
289417
import { STANDINGS, type Standing } from "@sportsdataverse/examples/data";
import { defineTable } from "@sportsdataverse/sdvtables";
import { renderHTMLAsync } from "@sportsdataverse/sdvtables/html";

const spec = defineTable<Standing>()
.columns((c) => [
c.logo("team", { league: "nfl" }),
c.int("pf", { label: "Points scored, regular season" }),
c.int("pa", { label: "Points allowed, regular season" }),
])
.wrapLabels({ width: 10 })
.title("AFC, 2024")
.build();
await renderHTMLAsync(spec, STANDINGS);

Tags: decoration · wrapLabels · gt_wrap_labels. All sdvtables examples.