From 1d4ce5a313d1c41e73c843587692eabebad96e00 Mon Sep 17 00:00:00 2001 From: Rachel Date: Sun, 4 Aug 2024 14:32:46 -0400 Subject: [PATCH] [bug-fix] Add padding to default markdown table cells (#2617) Default, meaning `pretty_table: false` ## Sample code ```md | First Column | Second Column | Third Column | |------------------|-----------------|----------------| | Sed in. | Sed non. | Morbi egestas. | | Donec facilisis. | Suspendisse eu. | Nulla porta. | | Praesent a. | Interdum et. | Sed nec. | ``` ### Current result current-default ### Proposed result updated-default --- _posts/2023-03-21-tables.md | 18 ++++++++++++++++-- _sass/_base.scss | 1 + 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/_posts/2023-03-21-tables.md b/_posts/2023-03-21-tables.md index da1d7e8..ca95499 100644 --- a/_posts/2023-03-21-tables.md +++ b/_posts/2023-03-21-tables.md @@ -10,7 +10,17 @@ related_posts: true pretty_table: true --- -Using markdown to display tables is easy. Just use the following syntax: +Using markdown to display tables is easy. + +## Simple Example + +First, add the following to the post's front matter + +```yml +pretty_table: true +``` + +Then, the following syntax ```markdown | Left aligned | Center aligned | Right aligned | @@ -20,7 +30,7 @@ Using markdown to display tables is easy. Just use the following syntax: | Left 3 | center 3 | right 3 | ``` -That will generate: +will generate | Left aligned | Center aligned | Right aligned | | :----------- | :------------: | ------------: | @@ -30,6 +40,8 @@ That will generate:

+## HTML Example + It is also possible to use HTML to display tables. For example, the following HTML code will display a table with [Bootstrap Table](https://bootstrap-table.com/), loaded from a JSON file: {% raw %} @@ -62,6 +74,8 @@ It is also possible to use HTML to display tables. For example, the following HT

+## More Complex Example + By using [Bootstrap Table](https://bootstrap-table.com/) it is possible to create pretty complex tables, with pagination, search, and more. For example, the following HTML code will display a table, loaded from a JSON file, with pagination, search, checkboxes, and header/content alignment. For more information, check the [documentation](https://examples.bootstrap-table.com/index.html). {% raw %} diff --git a/_sass/_base.scss b/_sass/_base.scss index 1cc3372..6273a08 100644 --- a/_sass/_base.scss +++ b/_sass/_base.scss @@ -27,6 +27,7 @@ table { td, th { font-size: 1rem; + padding: 1px 1rem 1px 0; } th {