tally: a record, with the share of one part
| Team | Record |
|---|---|
| KC | 15-2-0 (88.2%) |
| LAC | 11-6-0 (64.7%) |
| DEN | 10-7-0 (58.8%) |
| LV | 4-13-0 (23.5%) |
| BUF | 13-4-0 (76.5%) |
| MIA | 8-9-0 (47.1%) |
| NYJ | 5-12-0 (29.4%) |
| NE | 4-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.