update docs
diff --git a/README.md b/README.md
index 9485af6..1c7627f 100644
--- a/README.md
+++ b/README.md
@@ -4,7 +4,7 @@
***
-**If you find using `kableExtra` will "unload" LaTeX packages you defined in the yaml header, you need to install the latest dev version of `rmarkdown` from github. Please see [issue 5](https://github.com/haozhu233/kableExtra/issues/5) & [issue 11](https://github.com/haozhu233/kableExtra/issues/11) for details.**
+**If you find using `kableExtra` will "unload" LaTeX packages or settings you defined in the yaml header, you need to install the latest dev version of `rmarkdown` from github. Please see [issue 5](https://github.com/haozhu233/kableExtra/issues/5) & [issue 11](https://github.com/haozhu233/kableExtra/issues/11) for details.**
***
diff --git a/docs/awesome_table_in_html.Rmd b/docs/awesome_table_in_html.Rmd
index 4822594..7f5e00d 100644
--- a/docs/awesome_table_in_html.Rmd
+++ b/docs/awesome_table_in_html.Rmd
@@ -196,6 +196,8 @@
# 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.
+
+Warning: If you have a super long table, you should be cautious when you use `column_spec` as the xml node modification takes time.
```{r}
text_tbl <- data.frame(
Items = c("Item 1", "Item 2", "Item 3"),
@@ -211,3 +213,17 @@
column_spec(1, bold = T) %>%
column_spec(2, width = "30em")
```
+
+***
+
+The following features are introduced in `kableExtra` 0.3.0
+
+# Row Style Specification
+Similar with `column_spec`, you can define specifications for rows. Currently, you can either bold or italiciz an entire row. Note that, similar with other row-related functions in `kableExtra`, for the position of the target row, you don't need to count in header rows or the group labelling rows.
+
+```{r}
+kable(dt) %>%
+ kable_styling("striped", full_width = F) %>%
+ column_spec(7, bold = T) %>%
+ row_spec(5, bold = T)
+```
diff --git a/docs/awesome_table_in_html.html b/docs/awesome_table_in_html.html
index 6d12800..c735c60 100644
--- a/docs/awesome_table_in_html.html
+++ b/docs/awesome_table_in_html.html
@@ -11,7 +11,7 @@
<meta name="author" content="Hao Zhu" />
-<meta name="date" content="2017-05-26" />
+<meta name="date" content="2017-06-13" />
<title>Create Awesome HTML Table with knitr::kable and kableExtra</title>
@@ -217,7 +217,7 @@
<h1 class="title toc-ignore">Create Awesome HTML Table with knitr::kable and kableExtra</h1>
<h4 class="author"><em>Hao Zhu</em></h4>
-<h4 class="date"><em>2017-05-26</em></h4>
+<h4 class="date"><em>2017-06-13</em></h4>
</div>
@@ -3227,6 +3227,7 @@
<div id="column-style-specification" class="section level1">
<h1>Column Style Specification</h1>
<p>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 <code>column_spec()</code>. You can find an example below.</p>
+<p>Warning: If you have a super long table, you should be cautious when you use <code>column_spec</code> as the xml node modification takes time.</p>
<pre class="r"><code>text_tbl <- data.frame(
Items = c("Item 1", "Item 2", "Item 3"),
Features = c(
@@ -3279,6 +3280,160 @@
</tr>
</tbody>
</table>
+<hr />
+<p>The following features are introduced in <code>kableExtra</code> 0.3.0</p>
+</div>
+<div id="row-style-specification" class="section level1">
+<h1>Row Style Specification</h1>
+<p>Similar with <code>column_spec</code>, you can define specifications for rows. Currently, you can either bold or italiciz an entire row. Note that, similar with other row-related functions in <code>kableExtra</code>, for the position of the target row, you don’t need to count in header rows or the group labelling rows.</p>
+<pre class="r"><code>kable(dt) %>%
+ kable_styling("striped", full_width = F) %>%
+ column_spec(7, bold = T) %>%
+ row_spec(5, bold = T)</code></pre>
+<?xml version="1.0" encoding="UTF-8" ?>
+<table class="table table-striped" style="width: auto !important; margin-left: auto; margin-right: auto;">
+<thead>
+<tr>
+<th style="text-align:left;">
+</th>
+<th style="text-align:right;">
+mpg
+</th>
+<th style="text-align:right;">
+cyl
+</th>
+<th style="text-align:right;">
+disp
+</th>
+<th style="text-align:right;">
+hp
+</th>
+<th style="text-align:right;">
+drat
+</th>
+<th style="text-align:right;">
+wt
+</th>
+</tr>
+</thead>
+<tbody>
+<tr>
+<td style="text-align:left;">
+Mazda RX4
+</td>
+<td style="text-align:right;">
+21.0
+</td>
+<td style="text-align:right;">
+6
+</td>
+<td style="text-align:right;">
+160
+</td>
+<td style="text-align:right;">
+110
+</td>
+<td style="text-align:right;">
+3.90
+</td>
+<td style="text-align:right;font-weight: bold;">
+2.620
+</td>
+</tr>
+<tr>
+<td style="text-align:left;">
+Mazda RX4 Wag
+</td>
+<td style="text-align:right;">
+21.0
+</td>
+<td style="text-align:right;">
+6
+</td>
+<td style="text-align:right;">
+160
+</td>
+<td style="text-align:right;">
+110
+</td>
+<td style="text-align:right;">
+3.90
+</td>
+<td style="text-align:right;font-weight: bold;">
+2.875
+</td>
+</tr>
+<tr>
+<td style="text-align:left;">
+Datsun 710
+</td>
+<td style="text-align:right;">
+22.8
+</td>
+<td style="text-align:right;">
+4
+</td>
+<td style="text-align:right;">
+108
+</td>
+<td style="text-align:right;">
+93
+</td>
+<td style="text-align:right;">
+3.85
+</td>
+<td style="text-align:right;font-weight: bold;">
+2.320
+</td>
+</tr>
+<tr>
+<td style="text-align:left;">
+Hornet 4 Drive
+</td>
+<td style="text-align:right;">
+21.4
+</td>
+<td style="text-align:right;">
+6
+</td>
+<td style="text-align:right;">
+258
+</td>
+<td style="text-align:right;">
+110
+</td>
+<td style="text-align:right;">
+3.08
+</td>
+<td style="text-align:right;font-weight: bold;">
+3.215
+</td>
+</tr>
+<tr>
+<td style="text-align:left;font-weight: bold;">
+Hornet Sportabout
+</td>
+<td style="text-align:right;font-weight: bold;">
+18.7
+</td>
+<td style="text-align:right;font-weight: bold;">
+8
+</td>
+<td style="text-align:right;font-weight: bold;">
+360
+</td>
+<td style="text-align:right;font-weight: bold;">
+175
+</td>
+<td style="text-align:right;font-weight: bold;">
+3.15
+</td>
+<td style="text-align:right;font-weight: bold;font-weight: bold;">
+3.440
+</td>
+</tr>
+</tbody>
+</table>
</div>
diff --git a/docs/awesome_table_in_pdf.Rmd b/docs/awesome_table_in_pdf.Rmd
index dfd6745..aaded10 100644
--- a/docs/awesome_table_in_pdf.Rmd
+++ b/docs/awesome_table_in_pdf.Rmd
@@ -79,6 +79,16 @@
kable_styling(latex_options = c("striped", "scale_down"))
```
+### Repeat Header in longtable (only available in kableExtra 0.3.0)
+In this `kableExtra` 0.3.0, a new option `repeat_header` was introduced into `kable_styling`. It will add header rows to longtables spanning multiple pages. For table captions on following pages, it will append *"continued"* to the caption to differentiate. If you need texts other than *"(continued)"* (for example, other languages), you can specify it using `kable_styling(..., repeat_header_text = "xxx")`.
+```{r}
+long_dt <- rbind(mtcars, mtcars)
+
+kable(long_dt, longtable = T, booktabs = T, caption = "Longtable") %>%
+ add_header_above(c(" ", "Group 1" = 5, "Group 2" = 6)) %>%
+ kable_styling(latex_options = c("repeat_header"))
+```
+
## Full Width
If you have a small table and you want it to spread wide on the page, you can try the `full_width` option. Unlike `scale_down`, it won't change your font size. Note that, if you use `full_width` in LaTeX, you will loss your in-cell text alignment settings and everything will be left-aligned.
@@ -222,7 +232,7 @@
)
)
-kable(text_tbl) %>%
+kable(text_tbl, booktabs = T) %>%
kable_styling(full_width = F) %>%
column_spec(1, bold = T) %>%
column_spec(2, width = "30em")
@@ -230,14 +240,14 @@
***
-The following feature is introduced in `kableExtra` 0.3.0.
+The following features are introduced in `kableExtra` 0.3.0
-# Repeat Header in longtable
-In this release, a new option `repeat_header` was introduced into `kable_styling`. It will add header rows to longtables spanning multiple pages. For table captions on following pages, it will append *"continued"* to the caption to differentiate. If you need texts other than *"(continued)"* (for example, other languages), you can specify it using `kable_styling(..., repeat_header_text = "xxx")`.
+# Row Style Specification
+Similar with `column_spec`, you can define specifications for rows. Currently, you can either bold or italiciz an entire row. Note that, similar with other row-related functions in `kableExtra`, for the position of the target row, you don't need to count in header rows or the group labelling rows.
+
```{r}
-long_dt <- rbind(mtcars, mtcars)
-
-kable(long_dt, longtable = T, booktabs = T, caption = "Longtable") %>%
- add_header_above(c(" ", "Group 1" = 5, "Group 2" = 6)) %>%
- kable_styling(latex_options = c("repeat_header"))
+kable(dt, booktabs = T) %>%
+ kable_styling("striped", full_width = F) %>%
+ column_spec(7, bold = T) %>%
+ row_spec(5, bold = T)
```
diff --git a/docs/awesome_table_in_pdf.pdf b/docs/awesome_table_in_pdf.pdf
index d812066..5d6a188 100644
--- a/docs/awesome_table_in_pdf.pdf
+++ b/docs/awesome_table_in_pdf.pdf
Binary files differ