Skip to main content

tally: a record, with the share of one part

AFC, 2024: W-L-T (win share)
TeamRecord
KC15-2-0 (88.2%)
LAC11-6-0 (64.7%)
DEN10-7-0 (58.8%)
LV4-13-0 (23.5%)
BUF13-4-0 (76.5%)
MIA8-9-0 (47.1%)
NYJ5-12-0 (29.4%)
NE4-13-0 (23.5%)
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.text("team"),
c.tally(["wins", "losses", "ties"], { label: "Record", share: true, shareOf: 0 }),
])
.title("AFC, 2024: W-L-T (win share)")
.build();
await renderHTMLAsync(spec, STANDINGS);

Tags: kind · tally · gt_fmt_tally. All sdvtables examples.