Rapporter / pander

An R Pandoc Writer: Convert arbitrary R objects into markdown
http://rapporter.github.io/pander/
Open Software License 3.0
294 stars 66 forks source link

Fix col alignment for simple & multiline tables #254

Closed daroczig closed 8 years ago

daroczig commented 8 years ago

The simple and multiline tables uses left and right white-spaces for alignment -- so if the values fill up a cell, there's no way to identify if it's aligned left, right or center. For this end, we always have to add two extra space to each cell.

NOTE: this PR breaks many unit tests -- some of those are due to expecting the wrong value. Eg.

> pander(data.frame(a = '7 chars', b = paste(rep('Δ', 5), collapse = ' ')), style = 'simple')
   a        b    
------- ---------
7 chars Δ Δ Δ Δ Δ

Should be:

    a          b     
--------- -----------
 7 chars   Δ Δ Δ Δ Δ 

@RomanTsegelskyi can you please have a quick look to verify that my intuition is right on this?

daroczig commented 8 years ago

Ping @RomanTsegelskyi for some feedback on this.

RomanTsegelskyi commented 8 years ago

@daroczig, looks good to me

codecov-io commented 8 years ago

Current coverage is 75.67%

Merging #254 into master will decrease coverage by 0.92%

Powered by Codecov. Last updated by 4dbf472...6383329