Selaa lähdekoodia

Merge pull request #876 from zauberzeug/markdown_tables

add markdown tables demo + improved styling
Falko Schindler 2 vuotta sitten
vanhempi
säilyke
97f87704f3

+ 8 - 0
nicegui/static/nicegui.css

@@ -77,6 +77,14 @@
   padding: 1rem 1rem 0.5rem 1rem;
   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;

+ 12 - 0
website/more_documentation/markdown_documentation.py

@@ -39,3 +39,15 @@ 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'])