bug fix
diff --git a/docs/awesome_table_in_html.Rmd b/docs/awesome_table_in_html.Rmd
index b79235b..aa19e67 100644
--- a/docs/awesome_table_in_html.Rmd
+++ b/docs/awesome_table_in_html.Rmd
@@ -168,7 +168,7 @@
# Group Rows
Sometimes we want a few rows of the table being grouped together. They might be items under the same topic (e.g., animals in one species) or just different data groups for a categorical variable (e.g., age < 40, age > 40). With the new function `group_rows()` in `kableExtra`, this kind of task can be completed in one line. Please see the example below. Note that when you count for the start/end rows of the group, you don't need to count for the header rows nor other group label rows. You only need to think about the row numbers in the "original R dataframe".
```{r}
-kable(mtcars[1:10, 1:6], format = "html", caption = "Group Rows") %>%
+kable(mtcars[1:10, 1:6], caption = "Group Rows") %>%
kable_styling("striped", full_width = F) %>%
group_rows("Group 1", 4, 7) %>%
group_rows("Group 2", 8, 10)
@@ -176,7 +176,7 @@
For advanced users, you can even define your own css for the group labeling.
```{r}
-kable(dt, format = "html") %>%
+kable(dt) %>%
kable_styling("striped", full_width = F) %>%
group_rows("Group 1", 3, 5, label_row_css = "background-color: #666; color: #fff;")
```
@@ -185,7 +185,29 @@
Unlike `group_rows()`, which will insert a labeling row, sometimes we want to list a few sub groups under a total one. In that case, `add_indent()` is probably more apporiate.
For advanced users, you can even define your own css for the group labeling.
```{r}
-kable(dt, format = "html") %>%
+kable(dt) %>%
kable_styling("striped", full_width = F) %>%
add_indent(c(1, 3, 5))
```
+
+---
+
+The following feature is introduced in `kableExtra` 0.2.1.
+
+# Column Style Specification
+When you have a table with lots of explanatory texts, you may want to specified the column width for different column, since the auto adjust in HTML may not work in its best way while basic LaTeX table is really bad at handling text wrapping. Also, sometimes, you may want to highlight a column (e.g. a "Total" column) by making it bold. In these scenario, you can use `column_spec()`. You can find an example below.
+```{r}
+text_tbl <- data.frame(
+ Item = c("Item 1", "Item 2", "Item 3"),
+ FeatureA = c(
+ "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin vehicula tempor ex. Morbi malesuada sagittis turpis, at venenatis nisl luctus a. ",
+ "In eu urna at magna luctus rhoncus quis in nisl. Fusce in velit varius, posuere risus et, cursus augue. Duis eleifend aliquam ante, a aliquet ex tincidunt in. ",
+ "Vivamus venenatis egestas eros ut tempus. Vivamus id est nisi. Aliquam molestie erat et sollicitudin venenatis. In ac lacus at velit scelerisque mattis. "
+ )
+)
+
+kable(text_tbl, format = "html") %>%
+ kable_styling(full_width = F) %>%
+ column_spec(1, bold = T) %>%
+ column_spec(2, width = "30em")
+```