浏览代码

adding markdown tables example + improved styling

Rodja Trappe 2 年之前
父节点
当前提交
88638b685b
共有 2 个文件被更改,包括 23 次插入0 次删除
  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;
   margin: 1rem 0;
 }
 }
 
 
+.nicegui-markdown th {
+  padding: 0.5rem;
+  border: 1px solid #8884;
+}
+
+.nicegui-markdown td {
+  padding: 0.5rem;
+  border: 1px solid #8884;
+}
+
 #popup {
 #popup {
   position: fixed;
   position: fixed;
   bottom: 0;
   bottom: 0;

+ 13 - 0
website/more_documentation/markdown_documentation.py

@@ -39,3 +39,16 @@ def more() -> None:
             ui.run(dark=True)
             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'])