diff --git a/R/htmlTable.R b/R/htmlTable.R index 34d97e5..ad853b9 100644 --- a/R/htmlTable.R +++ b/R/htmlTable.R @@ -539,6 +539,8 @@ htmlTable.default <- function(x, table_id <- sprintf(" id='%s'", label) }else if(is.numeric(table_id)){ table_id <- paste0(" id='table_", table_id, "'") + }else if(table_id == FALSE){ + table_id <- "" } # A column counter that is used for diff --git a/inst/doc/general.R b/inst/doc/general.R index 11414f6..d178a1e 100644 --- a/inst/doc/general.R +++ b/inst/doc/general.R @@ -8,7 +8,7 @@ output <- matrix(1:4, htmlTable(output) ## ------------------------------------------------------------------------ -htmlTable(output, +htmlTable(output, ctable=c("solid", "double"), caption="A table caption above") ## ------------------------------------------------------------------------ diff --git a/inst/doc/general.Rmd b/inst/doc/general.Rmd index 7926abb..bd7822c 100644 --- a/inst/doc/general.Rmd +++ b/inst/doc/general.Rmd @@ -36,7 +36,7 @@ Table caption The table caption is simply the table description and can be either located above or below: ```{r} -htmlTable(output, +htmlTable(output, ctable=c("solid", "double"), caption="A table caption above") ``` diff --git a/inst/doc/general.html b/inst/doc/general.html index e7962fa..39db5d3 100644 --- a/inst/doc/general.html +++ b/inst/doc/general.html @@ -12,7 +12,7 @@ - + The htmlTable package @@ -70,7 +70,7 @@

The htmlTable package

Max Gordon

-

2016-07-24

+

2016-10-19

@@ -144,7 +144,7 @@

Basics

Table caption

The table caption is simply the table description and can be either located above or below:

-
htmlTable(output, 
+
htmlTable(output,  ctable=c("solid", "double"),
           caption="A table caption above")
@@ -177,13 +177,13 @@

Table caption

- - - @@ -2848,7 +2848,7 @@

Table footer

The footer usually contains specifics regarding variables and is always located at the foot of the table:

htmlTable(mx[1:2,1:2], 
           tfoot="A table footer")
-
+ Row 2 + 2 + 4
+
@@ -2899,7 +2899,7 @@

Zebra coloring (or banded colors)

Zebra coloring is also know as an alternating color pattern or row shading. It is most commonly applied to rows:

htmlTable(mx, 
           col.rgroup = c("none", "#F7F7F7"))
- +
@@ -3116,7 +3116,7 @@

Zebra coloring (or banded colors)

col.rgroup = c("none", "#F7F7F7"), rgroup = c(paste("Group", LETTERS[1:2]), ""), n.rgroup = c(2,2,nrow(mx) - 4)) - +
@@ -3341,7 +3341,7 @@

Zebra coloring (or banded colors)

We can also color the columns:

htmlTable(mx, 
           col.columns = c("none", "#F7F7F7"))
- +
@@ -3557,7 +3557,7 @@

Zebra coloring (or banded colors)

htmlTable(mx, 
           col.rgroup = c("none", "#F9FAF0"),
           col.columns = c("none", "#F1F0FA"))
- +
@@ -3788,7 +3788,7 @@

Putting it all together

rep("#F5FBFF", 4)), col.rgroup = c("none", "#F7F7F7"), css.cell = "padding-left: .5em; padding-right: .2em;") - +
diff --git a/inst/doc/tables.html b/inst/doc/tables.html index c912797..cbcc09a 100644 --- a/inst/doc/tables.html +++ b/inst/doc/tables.html @@ -12,7 +12,7 @@ - + Tables with htmlTable and some alternatives @@ -70,7 +70,7 @@

Tables with htmlTable and some alternatives

Max Gordon

-

2016-07-24

+

2016-10-19

@@ -126,7 +126,7 @@

The htmlTable-package

n.cgroup = c(2,2), caption="Basic table with both column spanners (groups) and row groups", tfoot="&dagger; A table footer commment")
- +
@@ -396,7 +396,7 @@

Example based upon Swedish statistics

n.rgroup = rep(5, 3), tfoot = txtMergeLines("&Delta;<sub>int</sub> correspnds to the change since start", "&Delta;<sub>std</sub> corresponds to the change compared to national average")) - +
@@ -1980,7 +1980,7 @@

Example based upon Swedish statistics

n.rgroup = rep(5, 3), tfoot = txtMergeLines("&Delta;<sub>int</sub> correspnds to the change since start", "&Delta;<sub>std</sub> corresponds to the change compared to national average")) - +
@@ -3566,7 +3566,7 @@

Example based upon Swedish statistics

n.rgroup = rep(5, 3), tfoot = txtMergeLines("&Delta;<sub>int</sub> correspnds to the change since start", "&Delta;<sub>std</sub> corresponds to the change compared to national average")) - +
@@ -5157,7 +5157,7 @@

Example based upon Swedish statistics

tfoot = txtMergeLines("&Delta;<sub>int</sub> correspnds to the change since start", "&Delta;<sub>std</sub> corresponds to the change compared to national average"), cspan.rgroup = 1) - +
@@ -6965,7 +6965,7 @@

Example based upon Swedish statistics

tfoot = txtMergeLines("&Delta;<sub>int</sub> correspnds to the change since start", "&Delta;<sub>std</sub> corresponds to the change compared to national average"), cspan.rgroup = 1) - +
@@ -9983,7 +9983,7 @@

The xtable-package

align = c("l", "c", "r")), type="html") - +
A test table