Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Help needed with tables #188

Open
robguinness opened this issue May 13, 2020 · 3 comments
Open

Help needed with tables #188

robguinness opened this issue May 13, 2020 · 3 comments

Comments

@robguinness
Copy link

Hi, I'm new to markdown-pdf. I have understood that remarkable is the underlying markdown parser. According to the remarkable docs, tables using GFM syntax are supported and enabled by default. However, when I tested this, the PDF output looks nothing like a nicely formatted table:

Screenshot from 2020-05-13 10-54-52

The corresponding markdown is:

| Key     | Description                                                   |
| ------- | ------------------------------------------------------------- |
| text    | A string representing the search query                        |
| count   | *(optional)* The number of results to return. Defaults to max |

Do I need to do anything special to enable this functionality or to format the table?

@xzela
Copy link

xzela commented Jun 29, 2020

Yeah, it took me a while to figure this out as well.

I believe it's the leading and trailing pipe symbols (|). Change your markdown code to look more like this:

Key    | Description                                                   
-------|-------------------------------------------------------------
text   | A string representing the search query                        
count  | *(optional)* The number of results to return. Defaults to max

@thomakj
Copy link

thomakj commented Jul 29, 2020

I have the same markdown style as you @robguinness and changing it did not work.
You need to set a css style for your table, e.g.
table, th, td { border: 1px solid black; }
Then have the markdown-pdf use your css file. I added the above to the css/pdf.css file and linked to it in this way markdown-pdf -s css/pdf.css

@JialuGong
Copy link

Duplicate of ##117

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants