highlight: a column's minimum and maximum
| Team | Wins | Points for |
|---|---|---|
| KC | 15 | 385 |
| LAC | 11 | 402 |
| DEN | 10 | 425 |
| LV | 4 | 309 |
| BUF | 13 | 525 |
| MIA | 8 | 345 |
| NYJ | 5 | 338 |
| NE | 4 | 289 |
import { STANDINGS, type Standing } from "@sportsdataverse/examples/data";
import { defineTable } from "@sportsdataverse/sdvtables";
import { renderHTMLAsync } from "@sportsdataverse/sdvtables/html";
// "both" marks the lowest value in red and the highest in green, bold, every tie included; "min" or "max" marks one.
const spec = defineTable<Standing>()
.columns((c) => [
c.text("team"),
c.highlight("wins", "both", { label: "Wins" }),
c.highlight("pf", "max", { label: "Points for", fill: "#FFF3B0", textColor: "#000000" }),
])
.title("AFC, 2024")
.build();
await renderHTMLAsync(spec, STANDINGS);
Tags: formatter · highlight · highlight_min · highlight_max · highlight_min_max · reactablefmtr. All sdvtables examples.