highlight: cells that match a predicate
| Team | Wins | Losses |
|---|---|---|
| KC | 15 | 2 |
| LAC | 11 | 6 |
| DEN | 10 | 7 |
| LV | 4 | 13 |
| BUF | 13 | 4 |
| MIA | 8 | 9 |
| NYJ | 5 | 12 |
| NE | 4 | 13 |
import { STANDINGS, type Standing } from "@sportsdataverse/examples/data";
import { defineTable } from "@sportsdataverse/sdvtables";
import { renderHTMLAsync } from "@sportsdataverse/sdvtables/html";
// The rule is data (a predicate), not a function, so the spec stays serializable.
const spec = defineTable<Standing>()
.columns((c) => [
c.text("team"),
c.highlight("wins", { key: "wins", op: ">=", value: 11 }, { label: "Wins", bold: true }),
c.int("losses"),
])
.title("AFC, 2024: 11 or more wins")
.build();
await renderHTMLAsync(spec, STANDINGS);
Tags: kind · highlight · gt_highlight_cells · predicate. All sdvtables examples.