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.
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_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 |
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 |
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 |
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 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 |
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 |
| 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 |
With placement="left", the footnote mark appears before the cell text rather than after it.