---
title: Header and Footer
jupyter: python3
html-table-processing: none
---

The way that we add components like the **Table Header** and *source notes* in the **Table Footer** is to use the `tab_*()` family of methods. A **Table Header** is easy to add so let's see how the previous table looks with a *title* and a *subtitle*. We can add this component using the [`tab_header()`](`great_tables.GT.tab_header`) method:

```{python}
from great_tables import GT, md, html
from great_tables.data import islands

islands_mini = islands.head(10)

# Make a display table with the `islands_tbl` table;
# put a heading just above the column labels
(
    GT(islands_mini)
    .tab_header(
        title = "Large Landmasses of the World",
        subtitle = "The top ten largest are presented"
    )
)
```

The **Header** table component provides an opportunity to describe the data that's presented. Using `subtitle=` allows us to insert a subtitle, which is an optional part of the **Header**. We may also style the `title=` and `subtitle=` using Markdown! We do this by wrapping the values passed to `title=` or `subtitle=` with the [`md()`](`great_tables.md`) helper function (we may also use [`html()`](`great_tables.html`) in a similar fashion). Here is an example with the table data truncated for brevity:

```{python}
# Make a display table with the `islands_tbl` table;
# put a heading just above the column labels
gt_tbl = (
    GT(islands.head(2))
    .tab_header(
        title = md("Large Landmasses of the *World* &#x1F310;"),
        subtitle = md("The top **ten** largest are presented")
    )
)

gt_tbl
```

A *source note* can be added to the table's **Footer** through use of the [`tab_source_note()`](`great_tables.GT.tab_source_note`) method. It works in the same way as [`tab_header()`](`great_tables.GT.tab_header`) (it also allows for Markdown inputs) except it can be called multiple times---each invocation results in the addition of a source note.

```{python}
# Display the `islands_tbl` data with a heading and two source notes
(
    gt_tbl
    .tab_source_note(
        source_note = "Source: The World Almanac and Book of Facts, 1975, page 406."
    )
    .tab_source_note(
        source_note = md("Reference: McNeil, D. R. (1977) *Interactive Data Analysis*. Wiley.")
    )
)
```
