Native markdown table + set property such as table placement, removal of table lines

Viewed 134

I want to render the below table on the left of the bookdown pdf

| Right | Left | Default | Center |
|------:|:-----|---------|:------:|
|   12  |  12  |    12   |    12  |
|  123  |  123 |   123   |   123  |
|    1  |    1 |     1   |     1  |

How to remove all the division lines

example table

How to move it to left?

2 Answers

Was able to get this to work by putting your table in a markdown chunk, and adding 2 parameters fig.align="left" and results='asis'

---
title: "Untitled"
author: "Daniel"
date: "10/30/2020"
output: pdf_document
---

```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```

```{markdown, fig.align="left", results='asis'}

| Right | Left | Default | Center |
|------:|:-----|---------|:------:|
|   12  |  12  |    12   |    12  |
|  123  |  123 |   123   |   123  |
|    1  |    1 |     1   |     1  |
```

enter image description here

To put the table on the left side. place the below lines in index.rmd

header-includes:
  - |
    ```{=latex}
    \usepackage[margins=raggedright]{floatrow}
    ```

and then you can draw the table as follows

| Right | Left | Default | Center |
|------:|:-----|---------|:------:|
|   12  |  12  |    12   |    12  |
|  123  |  123 |   123   |   123  |
|    1  |    1 |     1   |     1  |

You will not be able to freeze the column widths though

Related