-
-
Notifications
You must be signed in to change notification settings - Fork 150
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #878 from haozhu233/addheaderabove
Allow `align = "p{2cm}"` and similar in `add_header_above()`
- Loading branch information
Showing
8 changed files
with
62 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
Package: kableExtra | ||
Type: Package | ||
Title: Construct Complex Table with 'kable' and Pipe Syntax | ||
Version: 1.4.0.10 | ||
Version: 1.4.0.11 | ||
Authors@R: c( | ||
person('Hao', 'Zhu', email = '[email protected]', role = c('aut', 'cre'), | ||
comment = c(ORCID = '0000-0002-3386-6076')), | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# add_header_above accepts p{3cm} | ||
|
||
Code | ||
kbl(mtcars[1:3, 1:3], "latex") %>% add_header_above(c(" ", | ||
`This is a very long header that will need to be wrapped` = 3), align = c("l", | ||
"p{3cm}")) | ||
Output | ||
\begin{tabular}[t]{l|r|r|r} | ||
\hline | ||
\multicolumn{1}{l|}{ } & \multicolumn{3}{p{3cm}}{This is a very long header that will need to be wrapped} \\ | ||
\cline{2-4} | ||
& mpg & cyl & disp\\ | ||
\hline | ||
Mazda RX4 & 21.0 & 6 & 160\\ | ||
\hline | ||
Mazda RX4 Wag & 21.0 & 6 & 160\\ | ||
\hline | ||
Datsun 710 & 22.8 & 4 & 108\\ | ||
\hline | ||
\end{tabular} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
test_that("add_header_above accepts p{3cm}", { | ||
expect_snapshot( | ||
kbl( | ||
mtcars[1:3, 1:3], 'latex' | ||
) %>% | ||
add_header_above(c(' ', | ||
'This is a very long header that will need to be wrapped' = 3), | ||
align = c('l', 'p{3cm}'))) | ||
}) |