| ansi_align {cli} | R Documentation |
Align an ANSI colored string
ansi_align(
text,
width = console_width(),
align = c("left", "center", "right"),
type = "width"
)
text |
The character vector to align. |
width |
Width of the field to align in. |
align |
Whether to align |
type |
Passed on to |
The aligned character vector.
Other ANSI string operations:
ansi_columns(),
ansi_nchar(),
ansi_strsplit(),
ansi_strtrim(),
ansi_strwrap(),
ansi_substring(),
ansi_substr(),
ansi_trimws()
ansi_align(col_red("foobar"), 20, "left")
ansi_align(col_red("foobar"), 20, "center")
ansi_align(col_red("foobar"), 20, "right")