Skip to content

Commit 0f8dc26

Browse files
committed
Added example to readme
1 parent e787a1c commit 0f8dc26

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

README.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ Module for converting 2D Python lists to a fancy ASCII/Unicode tables
1010
- [table2ascii](#table2ascii)
1111
- [📥 Installation](#-installation)
1212
- [🧑‍💻 Usage](#-usage)
13+
- [🎨 Styles](#-styles)
1314
- [⚙️ Options](#️-options)
1415
- [👨‍🎨 Use cases](#-use-cases)
1516
- [Discord messages and embeds](#discord-messages-and-embeds)
@@ -90,6 +91,35 @@ print(output)
9091
"""
9192
```
9293

94+
```py
95+
from table2ascii import table2ascii, Styles
96+
97+
output = table2ascii(
98+
header=["#", "G", "H", "R", "S"],
99+
body=[["1", "30", "40", "35", "30"], ["2", "30", "40", "35", "30"]],
100+
footer=["SUM", "130", "140", "135", "130"],
101+
style=Styles.ascii_box,
102+
)
103+
104+
print(output)
105+
106+
"""
107+
+-----+-----+-----+-----+-----+
108+
| # | G | H | R | S |
109+
+-----+-----+-----+-----+-----+
110+
| 1 | 30 | 40 | 35 | 30 |
111+
+-----+-----+-----+-----+-----+
112+
| 2 | 30 | 40 | 35 | 30 |
113+
+-----+-----+-----+-----+-----+
114+
| SUM | 130 | 140 | 135 | 130 |
115+
+-----+-----+-----+-----+-----+
116+
"""
117+
```
118+
119+
## 🎨 Styles
120+
121+
See a list of all preset styles [here](/style_list).
122+
93123
## ⚙️ Options
94124

95125
All parameters are optional.

0 commit comments

Comments
 (0)