Comments (9)
Hi there,
Thanks for your feature request. I've been looking at the Pandoc Markdown
documentation, and it seems like one of the options for a table is the
following:
Right Left Center Default
------- ------ ---------- -------
12 12 12 12
123 123 123 123
1 1 1 1
(the specs call this "simple table syntax"). I believe it's possible to get
tables of this kind out of PrettyTable 0.7 and above by setting:
table.vrules = prettytable.NONE
table.hrules = prettytable.FRAME
Can you please let me know if this works for you in Pandoc?
If it does work, I'll make a PANDOC pre-define style (like the MSWORD_FRIENDLY
one) so future Pandoc users don't need to figure this out for themselves.
Thanks again,
Luke
Original comment by [email protected]
on 6 Oct 2013 at 11:12
from prettytable.
[deleted comment]
from prettytable.
[deleted comment]
from prettytable.
Got it, but it makes tables like this:
---------------------------------------
Right Left Center Default
---------------------------------------
12 12 12 12
123 123 123 123
1 1 1 1
---------------------------------------
Which I don't think will work.
Original comment by [email protected]
on 11 Oct 2013 at 2:53
from prettytable.
Confirmed that it does NOT work.
Pandoc is looking for separations between columns otherwise it can't figure out
that it's a table.
I think the best is still adding an option to the original table because it's
the nicest looking IMHO:
+---------------+---------------+--------------------+
| Fruit | Price | Advantages |
+===============+===============+====================+
| Bananas | $1.34 | - built-in wrapper |
| | | - bright color |
+---------------+---------------+--------------------+
| Oranges | $2.10 | - cures scurvy |
| | | - tasty |
+---------------+---------------+--------------------+
BUT this would also work I think:
---------------------------------------
Right Left Center Default
--------- -------- ---------- ---------
12 12 12 12
123 123 123 123
1 1 1 1
---------------------------------------
Original comment by [email protected]
on 11 Oct 2013 at 3:05
from prettytable.
How about:
table.hrules=HEADER
table.junction_char=" "
table.vertical_char=" "
This will produce:
foo bar baz
----- ----- -----
1 2 3
1 2 3
1 2 3
Which should work according to the Pandoc docs.
Original comment by [email protected]
on 13 Oct 2013 at 5:53
from prettytable.
There we go, that works great with pandoc! Thanks for the help.
Original comment by [email protected]
on 13 Oct 2013 at 6:09
from prettytable.
Wonderful! Glad it works. I will make sure that in the next release there is
a PANDOC preset which makes this easy. Thanks for letting me know about the
Pandoc compatibility issue.
Original comment by [email protected]
on 13 Oct 2013 at 6:24
from prettytable.
No problem, you might want to call it PANDOC_MARKDOWN or something similar
to indicate that this is for Pandoc markdown parsing.
Thanks for the very useful work!
Original comment by [email protected]
on 13 Oct 2013 at 6:28
from prettytable.
Related Issues (20)
- how to display "ambiguous" width in chinese character?
- table.min_width is broken when using PLAIN_COLUMNS style HOT 2
- Field alignment error when using "blessings" module HOT 1
- Adding colors to column values messes up the spacing HOT 2
- Setting float_format in **kwargs does not actually affect output - confusing behavior HOT 1
- Permissions are incorrect HOT 1
- Add date formatting for datetime etc instances HOT 3
- In get_string, end is eval before sortby
- HTML output is lacking borders, alignment
- Cannot print unicode characters, for example: degree symbol °
- Pandas DataFrame Table Factory HOT 3
- Upload new version to pypi
- xterm reset escape sequence not filtered HOT 2
- Support large tables in output HOT 1
- Prettytable 0.7.2 does not handle rowspan correctly
- Creating a PrettyTable inside a for. HOT 1
- Project Future and Plans HOT 4
- Export project to Github (or other git hosting project) HOT 2
- Stretching columns when the data are longer than the header
- Options not actually used in formatting rows
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 prettytable.