rowAccent: an edge colour per row
| Team | Wins | Losses |
|---|---|---|
![]() | 15 | 2 |
![]() | 11 | 6 |
![]() | 10 | 7 |
![]() | 4 | 13 |
![]() | 13 | 4 |
![]() | 8 | 9 |
![]() | 5 | 12 |
![]() | 4 | 13 |
import { STANDINGS, type Standing } from "@sportsdataverse/examples/data";
import { defineTable } from "@sportsdataverse/sdvtables";
import { renderHTMLAsync } from "@sportsdataverse/sdvtables/html";
// A palette maps each division to a colour; hide (the default) drops the division column itself.
const spec = defineTable<Standing>()
.columns((c) => [c.logo("team", { league: "nfl" }), c.text("division"), c.int("wins"), c.int("losses")])
.rowAccent("division", { palette: { East: "#00338D", West: "#E31837" }, width: 6 })
.title("AFC, 2024: East in blue, West in red")
.build();
await renderHTMLAsync(spec, STANDINGS);
Tags: decoration · rowAccent · gt_row_accent. All sdvtables examples.







