Browse Source

adding markdown tables example + improved styling

Rodja Trappe 2 years ago
parent
commit
88638b685b
2 changed files with 23 additions and 0 deletions
  1. 10 0
      nicegui/static/nicegui.css
  2. 13 0
      website/more_documentation/markdown_documentation.py

+ 10 - 0
nicegui/static/nicegui.css

@@ -78,6 +78,16 @@
   margin: 1rem 0;
 }
 
+.nicegui-markdown th {
+  padding: 0.5rem;
+  border: 1px solid #8884;
+}
+
+.nicegui-markdown td {
+  padding: 0.5rem;
+  border: 1px solid #8884;
+}
+
 #popup {
   position: fixed;
   bottom: 0;

+ 13 - 0
website/more_documentation/markdown_documentation.py

@@ -39,3 +39,16 @@ def more() -> None:
             ui.run(dark=True)
             ```
         ''')
+
+    @text_demo('Markdown tables', '''
+        By activating the "tables" extra, you can use markdown tables.
+        See the [markdown2 documentation](https://github.com/trentm/python-markdown2/wiki/Extras#implemented-extras) for a list of available extras.
+    ''')
+    def markdown_with_code_blocks():
+        ui.markdown('''
+        | First name | Last name |
+        | ---------- | --------- |
+        | Max        | Planck    |
+        | Marie      | Curie     |
+
+        ''', extras=['tables'])