fonts: false, and loading the fonts yourself
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Spline+Sans+Mono:wght@500&family=Work+Sans:wght@500;650&display=swap">
| 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, resolveTheme } from "@sportsdataverse/sdvtables";
import { fontsLink, prepare, renderHTML } from "@sportsdataverse/sdvtables/html";
const spec = defineTable<Standing>()
.columns((c) => [c.logo("team", { league: "nfl", includeName: true }), c.int("wins"), c.int("losses")])
.theme("athletic")
.title("AFC, 2024")
.build();
await prepare(spec);
// Every table starts with a Google Fonts <link> for its theme. fonts: false leaves it out; the page loads them
// once instead, e.g. with this <link> in its <head>:
const head = fontsLink(resolveTheme(spec.theme).fonts);
const escaped = head.replace(/&/g, "&").replace(/</g, "<");
`<p><code>${escaped}</code></p>\n${renderHTML(spec, STANDINGS, { fonts: false })}`;
Tags: table · renderHTML · fonts · fontsLink · nfl. All sdvtables examples.
KC
LAC
DEN
LV
BUF
MIA
NYJ
NE