md: Interpret input text as Markdown-formatted text

View source: R/helpers.R

mdR Documentation

Interpret input text as Markdown-formatted text


Markdown text can be used in certain places in a gt table, and this is wherever new text is defined (e.g., footnotes, source notes, the table title, etc.). Using Markdown is advantageous for styling text since it will be rendered correctly to the the output format of the gt table. There is also the html() helper that allows you use HTML exclusively (for tables expressly meant for HTML output) but md() allows for both; you get to use Markdown plus any HTML fragments at the same time.





Markdown text

⁠scalar<character>⁠ // required

The text that is understood to contain Markdown formatting.


A character object of class from_markdown. It's tagged as being Markdown text and it will undergo conversion to the desired output context.


Use the exibble dataset to create a gt table. When adding a title through the tab_header() function, we'll use the md() helper to signify to gt that we're using Markdown formatting.

exibble |>
  dplyr::select(currency, char) |>
  gt() |>
  tab_header(title = md("Using *Markdown*"))
This image of a table was generated from the first code example in the `md()` help file.

Function ID


Function Introduced

v0.2.0.5 (March 31, 2020)

See Also

Other helper functions: adjust_luminance(), cell_borders(), cell_fill(), cell_text(), cells_body(), cells_column_labels(), cells_column_spanners(), cells_footnotes(), cells_grand_summary(), cells_row_groups(), cells_source_notes(), cells_stub_grand_summary(), cells_stub_summary(), cells_stubhead(), cells_stub(), cells_summary(), cells_title(), currency(), default_fonts(), define_units(), escape_latex(), from_column(), google_font(), gt_latex_dependencies(), html(), nanoplot_options(), pct(), px(), random_id(), stub(), system_fonts()

gt documentation built on June 22, 2024, 11:11 a.m.

Related to md in gt...