Skip to main content

cutline: a dashed line after the nth row

AFC, 2024
TeamWinsLosses
152
134
116
107
89
512
413
413
import { STANDINGS, type Standing } from "@sportsdataverse/examples/data";
import { defineTable } from "@sportsdataverse/sdvtables";
import { renderHTMLAsync } from "@sportsdataverse/sdvtables/html";

// Sorted by wins, the four playoff teams among these eight sit above the line.
const rows = [...STANDINGS].sort((a, b) => b.wins - a.wins);
const spec = defineTable<Standing>()
.columns((c) => [c.logo("team", { league: "nfl" }), c.int("wins"), c.int("losses")])
.cutline(4, { label: ["Playoff line"] })
.title("AFC, 2024")
.build();
await renderHTMLAsync(spec, rows);

Tags: decoration · cutline · gt_cutline. All sdvtables examples.