colorResults: a row filled by its result
| Team | Qb | Last game |
|---|---|---|
| KC | Patrick Mahomes | L |
| LAC | Justin Herbert | W |
| DEN | Bo Nix | W |
| LV | Gardner Minshew | L |
| BUF | Josh Allen | L |
| MIA | Tua Tagovailoa | L |
| NYJ | Aaron Rodgers | W |
| NE | Drake Maye | W |
import { STANDINGS, type Standing } from "@sportsdataverse/examples/data";
import { defineTable } from "@sportsdataverse/sdvtables";
import { renderHTMLAsync } from "@sportsdataverse/sdvtables/html";
// The cell holds W or L; the whole row takes the win or loss fill.
const spec = defineTable<Standing>()
.columns((c) => [c.text("team"), c.text("qb"), c.colorResults("result_last", { label: "Last game" })])
.title("AFC, 2024: final regular-season game")
.build();
await renderHTMLAsync(spec, STANDINGS);
Tags: kind · colorResults · gt_color_results. All sdvtables examples.