Skip to main content

font: one Google font for the whole table

AFC, 2024
TeamQbWinsLosses
Patrick Mahomes152
Justin Herbert116
Bo Nix107
Gardner Minshew413
Josh Allen134
Tua Tagovailoa89
Aaron Rodgers512
Drake Maye413
import { STANDINGS, type Standing } from "@sportsdataverse/examples/data";
import { defineTable } from "@sportsdataverse/sdvtables";
import { renderHTMLAsync } from "@sportsdataverse/sdvtables/html";

// google: true (the default) adds the Google Fonts <link>; set it false for a font the page already loads.
const spec = defineTable<Standing>()
.columns((c) => [c.logo("team", { league: "nfl" }), c.text("qb"), c.int("wins"), c.int("losses")])
.font("Roboto Slab", { weight: 500 })
.title("AFC, 2024")
.build();
await renderHTMLAsync(spec, STANDINGS);

Tags: decoration · font · gt_set_font. All sdvtables examples.