Skip to content

Commit

Permalink
fix rstudio/bookdown#166: close the table with a dashed line when tab…
Browse files Browse the repository at this point in the history
…le header is empty
  • Loading branch information
yihui committed Jul 28, 2016
1 parent 46dbd61 commit ad5b0bf
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions R/table.R
Expand Up @@ -336,8 +336,10 @@ kable_markdown = function(x, padding = 1, ...) {
}

kable_pandoc = function(x, caption = NULL, padding = 1, ...) {
tab = kable_mark(x, c(NA, '-', if (is.null(colnames(x))) '-' else NA),
padding = padding, ...)
tab = kable_mark(
x, c(NA, '-', if (is_blank(colnames(x))) '-' else NA),
padding = padding, ...
)
if (identical(caption, NA)) caption = NULL
if (length(caption)) c(paste('Table:', caption), "", tab) else tab
}
Expand Down

0 comments on commit ad5b0bf

Please sign in to comment.