Skip to content

Footnotes are rendered in separate lines/paragraphs with footnotes.sep = " " #833

@0xlevel

Description

@0xlevel

I would like to put the footnotes consecutively (inline) in one cell to adhere to APA style. Therefore I set
footnotes.sep = " ", to override the default linebreak as stated in the man-page (repex below).
In RStudio and in the knitted HTML each footnote is embedded in a <p>-Tag and therefore displayed in separate lines (with the separator at the end, so the test case is fine ;) ).

Is this a bug or expected behavior?
If the latter, the help page for tab_options might be misleading:

footnotes.sep | The separating characters between adjacent footnotes in the footnotes section. The default value produces a linebreak.

Is there a way to render all footnotes consecutively in one line? — Besides using CSS to set the ".gt_footnotes" class to display: inline.

library(gt, magrittr)
data.frame(A = 1:3) %>%
  gt() %>%
  tab_footnote(
    footnote = "This is column A.",
    locations = cells_column_labels(
      columns = A
    )
  ) %>%
  tab_footnote(
    footnote = "This is not column B.",
    locations = cells_column_labels(
      columns = A
    )
  ) %>%
  tab_options(
    footnotes.sep = " "
  )

Resulting html for the table footer:

<tfoot>
    <tr class="gt_footnotes">
      <td colspan="1">
        <p class="gt_footnote">
          <sup class="gt_footnote_marks">
            <em>1</em>
          </sup>
           
          This is column A.
           
        </p>
        <p class="gt_footnote">
          <sup class="gt_footnote_marks">
            <em>2</em>
          </sup>
           
          This is not column B.
           
        </p>
      </td>
    </tr>
  </tfoot>

btw: I <3 gt! Thank you!

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions