Comments (5)
Thanks again!
After having a quick view on the PHP Markdown Extra syntax, implementing the alignment would not be much problematic IMHO. As the "simple" style already supports the alignment of the cells, only the separator should be updated for the rmarkdown
style - as written on the PHP Markdown Extra homepage:
You can specify alignment for each column by adding colons to separator lines. A colon at the left of the separator line will make the column left-aligned; a colon on the right of the line will make the column right-aligned; colons at both side means the column is center-aligned.
So only the sep.hdr
needs some update for the alignment if I am right. Could you tweak that please? If not, I would happily get the time to add that in the next few days.
And as I have never used this syntax: what happens if there is no header or col.names
in the object with PHP Markdown Extra/knitr
?
For example:
> pandoc.table(matrix(1:4, 2, 2))
---
1 3
2 4
---
from pander.
I hadn't thought considered when the object has no colnames: the table format seems to require the column names line, even if the column names are blank, so in order to get that matrix to print, you need:
| | |
|---|---|
| 1 | 3 |
| 2 | 4 |
I've created a new branch for myself to work on these kinds of issues without adding dozens of commits to the pull request, I'll see what I can put together over the next couple of days. I think I already have the tables working when there are no colnames, but I'll do some further testing and try to get alignment working as well.
from pander.
Awesome, thank you very much!
Please feel free to ping me at any time if I could help you with anything, and also please go ahead with adding dozens of commits to the pull request, IMHO there is no problem with that. Okay, thanks again.
from pander.
Alright, I now have the table style working with blank column names, and I've written a helper function to align all the columns according to the justify
argument. I've only done some basic testing so far, but it's all looking good.
Here's some very quick examples of the results:
RMarkdown input file
Resulting Markdown file
HTML produced by knitr
It should all be in the pull request if you're happy to merge.
from pander.
That's awesome, thanks a lot!
Of course I've merged your commits.
from pander.
Related Issues (20)
- cor.test support
- Feature request: org-mode style
- Feature request: Use link references in tables
- Quality-of-life request: Invisibly return table in pander.data.frame and pandoc.table HOT 1
- emphasize.strong.rows fails
- Export keys.as.row.names to panderOptions HOT 1
- Sublist in a Table Causes Random Pipe Symbols to Appear HOT 1
- Let "grid"-styled `pandoc.table`s accept empty lines in cells HOT 3
- want table with image and line.break at the same time HOT 2
- Multiline tables with keep.line.breaks = TRUE not working for me HOT 1
- pander Does Not Render Wide Tables In Landscape Format In PDF Document with Rmd HOT 4
- Typo in `pander` documentation
- Security: XSS and prototype pollution from legacy jQuery HOT 4
- splitLine function not working when string doesn't contain any spaces. HOT 1
- pander() Converts \item to \emph In Bulleted Lists HOT 2
- Missing lines in wrapped tables
- partial match on x$coeff
- Incorrect table cell width with Unicode soft-hyphen character
- Preserve src formatting in evals HOT 4
- keep.trailing.zeros creates error in pander.table
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pander.