Footnotes

Footnotes provide a way to annotate specific cells, columns, or other table parts with additional context without cluttering the main display. Great Tables manages footnotes as a system: marks are automatically sequenced, placed consistently, and matched to their explanatory text in the table footer.

A Basic Footnote

Adding a footnote requires two things: the footnote text and a location specifier indicating where the footnote mark should appear. The tab_footnote() method handles both, placing the mark at the targeted location and appending the text to the footer.

from great_tables import GT, md, loc
from great_tables.data import airquality

air_mini = airquality.head(5)

(
    GT(air_mini)
    .tab_header(title="New York Air Quality", subtitle="Daily measurements, May 1973")
    .tab_footnote(
        footnote="Measured in parts per billion (ppbV).",
        locations=loc.column_labels(columns="Ozone")
    )
)
New York Air Quality
Daily measurements, May 1973
Ozone1 Solar_R Wind Temp Month Day
41.0 190.0 7.4 67 5 1
36.0 118.0 8.0 72 5 2
12.0 149.0 12.6 74 5 3
18.0 313.0 11.5 62 5 4
14.3 56 5 5
1 Measured in parts per billion (ppbV).

The footnote mark (a superscript number) appears next to the "Ozone" column label, and the corresponding text appears at the bottom of the table.

Targeting Different Locations

Footnotes can be attached to many different parts of the table. The locations= argument accepts any of the loc specifiers that support footnotes. Here are some of the most common targets.

Column Labels

Attaching a footnote to a column label is useful for clarifying units or methodology.

(
    GT(air_mini)
    .tab_header(title="New York Air Quality", subtitle="Daily measurements, May 1973")
    .tab_footnote(
        footnote="Solar radiation in Langleys (cal/cm²), measured 08:00–noon.",
        locations=loc.column_labels(columns="Solar_R")
    )
)
New York Air Quality
Daily measurements, May 1973
Ozone Solar_R1 Wind Temp Month Day
41.0 190.0 7.4 67 5 1
36.0 118.0 8.0 72 5 2
12.0 149.0 12.6 74 5 3
18.0 313.0 11.5 62 5 4
14.3 56 5 5
1 Solar radiation in Langleys (cal/cm²), measured 08:00–noon.

Body Cells

You can annotate specific data cells by targeting them with loc.body().

(
    GT(air_mini)
    .tab_header(title="New York Air Quality", subtitle="Daily measurements, May 1973")
    .tab_footnote(
        footnote="Highest temperature in this sample.",
        locations=loc.body(columns="Temp", rows=[0])
    )
)
New York Air Quality
Daily measurements, May 1973
Ozone Solar_R Wind Temp Month Day
41.0 190.0 7.4 1 67 5 1
36.0 118.0 8.0 72 5 2
12.0 149.0 12.6 74 5 3
18.0 313.0 11.5 62 5 4
14.3 56 5 5
1 Highest temperature in this sample.

The Title or Subtitle

Footnotes on the table header can provide methodological notes or data source context.

(
    GT(air_mini)
    .tab_header(title="New York Air Quality", subtitle="Daily measurements, May 1973")
    .tab_footnote(
        footnote="Data collected at a monitoring station in midtown Manhattan.",
        locations=loc.title()
    )
)
New York Air Quality1
Daily measurements, May 1973
Ozone Solar_R Wind Temp Month Day
41.0 190.0 7.4 67 5 1
36.0 118.0 8.0 72 5 2
12.0 149.0 12.6 74 5 3
18.0 313.0 11.5 62 5 4
14.3 56 5 5
1 Data collected at a monitoring station in midtown Manhattan.

Multiple Footnotes

You can add multiple footnotes to a single table. Each call to tab_footnote() creates a new footnote with its own sequenced mark. The marks are numbered in the order they appear in the table (reading left-to-right, top-to-bottom).

(
    GT(air_mini)
    .tab_header(title="New York Air Quality", subtitle="Daily measurements, May 1973")
    .tab_footnote(
        footnote="Mean ozone concentration, 13:00–15:00.",
        locations=loc.column_labels(columns="Ozone")
    )
    .tab_footnote(
        footnote="Maximum daily temperature in degrees Fahrenheit.",
        locations=loc.column_labels(columns="Temp")
    )
    .tab_footnote(
        footnote="Measurement device was recalibrated on this day.",
        locations=loc.body(columns="Ozone", rows=[2])
    )
)
New York Air Quality
Daily measurements, May 1973
Ozone1 Solar_R Wind Temp2 Month Day
41.0 190.0 7.4 67 5 1
36.0 118.0 8.0 72 5 2
3 12.0 149.0 12.6 74 5 3
18.0 313.0 11.5 62 5 4
14.3 56 5 5
1 Mean ozone concentration, 13:00–15:00.
2 Maximum daily temperature in degrees Fahrenheit.
3 Measurement device was recalibrated on this day.

Three footnote marks are placed in the table, and three corresponding notes appear in the footer, each with its sequential number.

Footnotes Without a Mark

If you want to include explanatory text in the footer without attaching a mark to any cell, omit the locations= argument (or set it to None).

(
    GT(air_mini)
    .tab_header(title="New York Air Quality", subtitle="Daily measurements, May 1973")
    .tab_footnote(footnote="All measurements taken in New York City, 1973.")
)
New York Air Quality
Daily measurements, May 1973
Ozone Solar_R Wind Temp Month Day
41.0 190.0 7.4 67 5 1
36.0 118.0 8.0 72 5 2
12.0 149.0 12.6 74 5 3
18.0 313.0 11.5 62 5 4
14.3 56 5 5
All measurements taken in New York City, 1973.

This is useful for general notes that apply to the entire table rather than to a specific cell or label.

Controlling Mark Placement

The placement= argument determines where the footnote mark appears relative to the cell content. The options are "auto" (the default), "left", and "right".

(
    GT(air_mini)
    .tab_header(title="New York Air Quality", subtitle="Daily measurements, May 1973")
    .tab_footnote(
        footnote="Measured at ground level.",
        locations=loc.column_labels(columns="Ozone"),
        placement="left"
    )
)
New York Air Quality
Daily measurements, May 1973
1 Ozone Solar_R Wind Temp Month Day
41.0 190.0 7.4 67 5 1
36.0 118.0 8.0 72 5 2
12.0 149.0 12.6 74 5 3
18.0 313.0 11.5 62 5 4
14.3 56 5 5
1 Measured at ground level.

With placement="left", the footnote mark appears before the cell text rather than after it.

Using Markdown in Footnotes

Footnote text supports Markdown formatting through the md() helper function. This lets you include emphasis, links, or other inline formatting in your footnotes.

(
    GT(air_mini)
    .tab_header(title="New York Air Quality", subtitle="Daily measurements, May 1973")
    .tab_footnote(
        footnote=md("Source: *Interactive Data Analysis* (McNeil, 1977)."),
        locations=loc.title()
    )
)
New York Air Quality1
Daily measurements, May 1973
Ozone Solar_R Wind Temp Month Day
41.0 190.0 7.4 67 5 1
36.0 118.0 8.0 72 5 2
12.0 149.0 12.6 74 5 3
18.0 313.0 11.5 62 5 4
14.3 56 5 5
1 Source: Interactive Data Analysis (McNeil, 1977).

Footnotes are a subtle but important tool for building informative tables. They let you add precision and context where it matters most, keeping the main table body clean while ensuring readers have access to the details they need. The automatic sequencing and placement system means you can focus on content rather than managing mark numbers manually.