Skip to main content

teamColorBg: a cell tinted with the team colour

AFC, 2024: secondary colours at 50%
TeamQbWins
KCPatrick Mahomes15
LACJustin Herbert11
DENBo Nix10
LVGardner Minshew4
BUFJosh Allen13
MIATua Tagovailoa8
NYJAaron Rodgers5
NEDrake Maye4
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.teamColorBg("team", { league: "nfl", which: "secondary", alpha: 0.5 }),
c.text("qb"),
c.int("wins"),
])
.title("AFC, 2024: secondary colours at 50%")
.build();
await renderHTMLAsync(spec, STANDINGS);

Tags: kind · teamColorBg · reactable_sdv_team_color_bg · nfl. All sdvtables examples.