![]() To add parameters to how the markdown table is formatted, you can use the set_params() function on a markdown_table object, i.e. You can also use pandas dataframes by formatting them as follows: from py_markdown_table.markdown_table import markdown_table | six-pack? An abdominal snowman! | Because they might crack up! | house? Igloos it together! | | What do you call a snowman with a | Why don't eggs tell jokes? | How does a penguin build its | | | negative numbers? He will stop at | | | Because they make up everything! | mathematician who's afraid of | other? They don't have the guts! | | Why don't scientists trust atoms? | Did you hear about the | Why don't skeletons fight each | Markdown = markdown_table(jokes_list).set_params(padding_width = 3, "joke3": "How does a penguin build its house? Igloos it together!" "joke2": "Why don't eggs tell jokes? Because they might crack up!", ![]() "joke1": "What do you call a snowman with a six-pack? An abdominal snowman!", "joke3": "Why don't skeletons fight each other? They don't have the guts!" "joke2": "Did you hear about the mathematician who's afraid of negative numbers? He will stop at nothing to avoid them!", "joke1": "Why don't scientists trust atoms? Because they make up everything!", ![]() Markdown = markdown_table(data).get_markdown()Ī more comprehensive example showcasing some of the formatting options: from py_markdown_table.markdown_table import markdown_table Simple example with no special formatting: from py_markdown_table.markdown_table import markdown_table Pass a list of dicts where the dicts must have uniform keys which serve as column headers and the values are expanded to be rows. Install via pip as follows: pip install py-markdown-table Tiny and fast python library with zero dependencies which generates formatted multiline tables in markdown including rendering emojis.
0 Comments
Leave a Reply. |