Skip to content

Latest commit

 

History

History
70 lines (52 loc) · 1.51 KB

README.md

File metadata and controls

70 lines (52 loc) · 1.51 KB

Xtable

install

devtools::install_github("6Youcai/Xtable")

Tables

common tables can be generated by markdown like this:

First Header  | Second Header
------------- | -------------
Content Cell  | Content Cell
Content Cell  | Content Cell

rowspan

I defined $v2; for a cell than spans to the down for two rows;

library(Xtable)
text <- "First Header  | Second Header | Third Header
------------- | ------------- | ------------
$v2;Content Cell 1 | Content Cell 2 | Content Cell 3
Content Cell 4 | Content Cell 5  
"
Xtable::Mtable(text)

in R markdown, these code will generate

colspan

similarly, $>3; means a cell that spans to the right for three cols.

text <- "
First Header  | Second Header | Third Header | Fourth Header
------------- | ------------- | ------------ | -------------  
Content Cell 1 | Content Cell 2 | Content Cell 3 | Content Cell 4
Content Cell 5 |$>3;Content Cell 6
$>2;Content Cell 7| Content Cell 8| Content Cell 9
"
Mtable(text)

mixed

text <- "
Content Cell 1 | Content Cell 2  | Content Cell 3 | Content Cell 4 | Content Cell 5
Content Cell 6  | $v2;$>2;Content Cell  7 | Content Cell 8
Content Cell  9| Content Cell  10| Content Cell 11
Content Cell 12 | Content Cell  13| Content Cell 14| Content Cell 15 
Content Cell  16| Content Cell  17| $>3;Content Cell 18 
"
Mtable(text)