Option To Align The Table Header — Opt_align_table_header • Gt
Có thể bạn quan tâm
- Get started
- Reference
- Articles
- Creating Summary Lines
Case studies
- Case Study: gtcars
- Case Study: Clinical Tables
Datasets
- gt Datasets
- More articles...
- News
Releases
- Version 0.11.0
- Version 0.10.0
- Version 0.9.0
- Version 0.8.0
- Version 0.7.0
- Version 0.6.0
- Changelog
-
- Light
- Dark
- Auto
By default, a table header added to a gt table has center alignment for both the title and the subtitle elements. This function allows us to easily set the horizontal alignment of the title and subtitle to the left or right by using the "align" argument. This function serves as a convenient shortcut for <gt_tbl> |> tab_options(heading.align = <align>).
Usage
opt_align_table_header(data, align = c("left", "center", "right"))Arguments
dataThe gt table data object
obj:<gt_tbl> // required
This is the gt table object that is commonly created through use of the gt() function.
alignHeader alignment
singl-kw:[left|center|right] // default: "left"
The alignment of the title and subtitle elements in the table header. Options are "left" (the default), "center", or "right".
Value
An object of class gt_tbl.
Examples
Use the exibble dataset to create a gt table with a number of table parts added (using functions like summary_rows(), grand_summary_rows(), and more). Following that, we'll align the header contents (consisting of the title and the subtitle) to the left with the opt_align_table_header() function.
exibble |> gt(rowname_col = "row", groupname_col = "group") |> summary_rows( groups = "grp_a", columns = c(num, currency), fns = c("min", "max") ) |> grand_summary_rows( columns = currency, fns = total ~ sum(., na.rm = TRUE) ) |> tab_source_note(source_note = "This is a source note.") |> tab_footnote( footnote = "This is a footnote.", locations = cells_body(columns = 1, rows = 1) ) |> tab_header( title = "The title of the table", subtitle = "The table's subtitle" ) |> opt_align_table_header(align = "left")
Function ID
10-7
Function Introduced
v0.2.0.5 (March 31, 2020)
See also
Other table option functions: opt_all_caps(), opt_css(), opt_footnote_marks(), opt_footnote_order(), opt_footnote_spec(), opt_horizontal_padding(), opt_interactive(), opt_row_striping(), opt_stylize(), opt_table_font(), opt_table_lines(), opt_table_outline(), opt_vertical_padding()
On this page
Từ khóa » Html Column Header Center Align
-
Align Text In A Table Header - Stack Overflow
-
HTML Th Tag - W3Schools
-
How To Set Heading Alignment In HTML? - Tutorialspoint
-
How To Center Align Text In Table Cells In HTML? - Tutorialspoint
-
Text-align:center Style Not Working In Table Header - Codecademy
-
How To Align Text Center In Table Heading? - Codecademy
-
HTML |
Align Attribute - GeeksforGeeks HTML | Align Attribute - GeeksforGeeks
Specifying Header Orientation And Header Text Alignment For Multiple ...
Column Header Alignment In Kendo UI For JQuery | Telerik Forums
Column Headers And Grid Cells Center Text Alignment - JQWidgets
Specifying Header Orientation And Header Text Alignment For An ...
How To Set Different Text Alignment To Content And Header - Grid
Set Text Alignment - Flextable - ArData
Copyright © 2022 | Thiết Kế Truyền Hình Cáp Sông Thu