# HTML table with default Observables font?

**URL:** <https://talk.observablehq.com/t/html-table-with-default-observables-font/6625>\
**Category:** Help\
**Created:** [May 27, 2022, 10:06pm UTC](https://talk.observablehq.com/t/html-table-with-default-observables-font/6625 "2022-05-27T22:06:14Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Lao](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.observablehq.com/lao/32/5668_2.png) [@Lao](https://talk.observablehq.com/u/Lao)\
**Post date:** [May 27, 2022, 10:06pm UTC](https://talk.observablehq.com/t/html-table-with-default-observables-font/6625/1 "2022-05-27T22:06:14Z")

</div>

I’d like to use html tables to format a notebook, but the default html font is different than what is used by default in the notebook. Is there any way to fix this?

---

<div class="post-metadata">

**Author:** ![tophtucker](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.observablehq.com/tophtucker/32/4781_2.png) [@tophtucker](https://talk.observablehq.com/u/tophtucker)\
**Post date:** [May 27, 2022, 10:53pm UTC](https://talk.observablehq.com/t/html-table-with-default-observables-font/6625/2 "2022-05-27T22:53:26Z")

</div>

The default CSS sets three variables for three groups of font families:

```css
:root {
  --serif: "Source Serif Pro", "Iowan Old Style", "Apple Garamond",
    "Palatino Linotype", "Times New Roman", "Droid Serif", Times, serif,
    "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
  --sans-serif: -apple-system, BlinkMacSystemFont, "avenir next", avenir,
    helvetica, "helvetica neue", ubuntu, roboto, noto, "segoe ui", arial,
    sans-serif;
  --monospace: Menlo, Consolas, monospace;
}

```

You can use those variables in your own code. So, for example, you can write `font-family: var(--serif)` in the style attribute of any HTML and get Source Serif Pro (or one of its fallbacks).

By default, serif is used for headings and paragraphs; sans-serif is used for tables and inputs; monospace is used for code blocks. For example:

```css
html {
  font: 17px/1.5 var(--serif);
}

table {
  font: 13px/1.2 var(--sans-serif);
}

pre {
  font: 14px/1.5 var(--monospace);
}

```

Here’s an example where I have a table using the default paragraph font:

> **[Table with serif font](https://observablehq.com/@tophtucker/table-with-serif-font)**
>
> Re: Lao in the forum: I’d like to use html tables to format a notebook, but the default html font is different than what is used by default in the notebook. Is there any way to fix this? Here’s a table using the default paragraph font styles:

I’m not sure I’ve understood exactly what you’re trying to do, so if you have an example notebook where something’s not working, post a link and I can take a look.

---

<div class="post-metadata">

**Author:** ![Lao](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.observablehq.com/lao/32/5668_2.png) [@Lao](https://talk.observablehq.com/u/Lao)\
**Post date:** [May 27, 2022, 11:17pm UTC](https://talk.observablehq.com/t/html-table-with-default-observables-font/6625/3 "2022-05-27T23:17:53Z")

</div>

This is exactly what I needed, thank you so much! (^u^)
