title: Indentation in the first column of a flextable object
body: <p>I am building <code>flextable</code> objects to show tables, and sometimes I would like to add one or several indentations in the first column, where I show some rows' names.</p>
  <p>Next I share some code to simulate some data and have a reproducible example. The true starting point of my question is <code>ft</code> (<a href="https://i.stack.imgur.com/nV7Ww.jpg" rel="nofollow noreferrer">Table 1</a>):</p>
  <pre><code>library(dplyr)
  library(flextable)
  
  # Simulate data
  g_A &lt;- expand.grid(x = &quot;A&quot;, y = c(&quot;A_1&quot;, &quot;A_2&quot;), z = c(&quot;A_1_a&quot;, &quot;A_1_b&quot;, &quot;A_2_a&quot;, &quot;A_2_b&quot;))
  g_B &lt;- expand.grid(x = &quot;B&quot;, y = c(&quot;B_1&quot;, &quot;B_2&quot;), z = c(&quot;B_1_a&quot;, &quot;B_1_b&quot;, &quot;B_2_a&quot;, &quot;B_2_b&quot;))
  g &lt;- rbind(g_A, g_B)
  n &lt;- 123
  set.seed(1)
  df &lt;- sample_n(g, n, replace = TRUE)
  
  # Build table
  tmp &lt;- c(table(df$x)[1],
           table(df$y)[1],
           table(df$z)[1:2],
           table(df$y)[2],
           table(df$z)[3:4],
           table(df$x)[2],
           table(df$y)[3],
           table(df$z)[5:6],
           table(df$y)[4],
           table(df$z)[7:8])
  my_tab &lt;- data.frame(&quot;tmp&quot; = names(tmp), &quot;counts&quot; = tmp, &quot;percentages&quot; = round(tmp/n*100, 2))
  
  # flextable operations
  ft &lt;- flextable(my_tab)
  ft &lt;- set_header_labels(ft, tmp = &quot;&quot;)
  ft &lt;- align(ft, align = &quot;center&quot;)
  ft &lt;- align(ft, j = 1, align = &quot;left&quot;)
  # ft
  </code></pre>
  <p>Now, I would like to indent some names in the first column. For example, to indent <code>A_1</code> I have tried the following strategies:</p>
  <pre><code>compose(ft, i = 2, j = 1, as_paragraph(&quot; A_1&quot;))
  compose(ft, i = 2, j = 1, as_paragraph(&quot;\t A_1&quot;))
  # Or
  # colformat_char(ft, i = 2, j = 1, prefix = &quot; &quot;)
  # colformat_char(ft, i = 2, j = 1, prefix = &quot;\t&quot;)
  </code></pre>
  <p>But they don't work (the result is the same as in Table 1). A &quot;second best&quot; strategy could be the following one <a href="https://i.stack.imgur.com/cRXsg.jpg" rel="nofollow noreferrer">(Table 2)</a>:</p>
  <pre><code>compose(ft, i = 2, j = 1, as_paragraph(&quot;- A_1&quot;))
  # Or
  # colformat_char(ft, i = 2, j = 1, prefix = &quot;- &quot;)
  </code></pre>
  <p>However, I would like a proper indentation.</p>
  <p>Finally, I share <a href="https://i.stack.imgur.com/bG6Mj.jpg" rel="nofollow noreferrer">Table 3</a>, my expected final result, with an indentation in place of each &quot;-&quot;.</p>
  <p>Waiting for your insights!</p>
  <p>Ciao</p>