Skip to main content

renderHTML

TeamPoints forPoints against
BUF525368
DEN425311
LAC402301
import { defineTable } from "@sportsdataverse/sdvtables";
import { renderHTML } from "@sportsdataverse/sdvtables/html";

const rows = [
{ team: "BUF", pf: 525, pa: 368 },
{ team: "DEN", pf: 425, pa: 311 },
{ team: "LAC", pf: 402, pa: 301 },
];
const spec = defineTable<(typeof rows)[number]>()
.columns((c) => [c.text("team"), c.int("pf", { label: "Points for" }), c.int("pa", { label: "Points against" })])
.theme("athletic")
.build();
renderHTML(spec, rows);

Tags: docstring · renderHTML. All sdvtables examples.