@@ -95,24 +95,22 @@ print(output)
9595from table2ascii import table2ascii, Styles
9696
9797output = 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,
98+ header = [" First " , " Second " , " Third " , " Fourth " ],
99+ body = [[" 10 " , " 30" , " 40" , " 35" ], [" 20 " , " 10 " , " 20 " , " 5 " ]],
100+ column_widths = [ 10 ] * 4 ,
101+ style = Styles.ascii_box
102102)
103103
104104print (output)
105105
106106"""
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- +-----+-----+-----+-----+-----+
107+ +----------+----------+----------+----------+
108+ | First | Second | Third | Fourth |
109+ +----------+----------+----------+----------+
110+ | 10 | 30 | 40 | 35 |
111+ +----------+----------+----------+----------+
112+ | 20 | 10 | 20 | 5 |
113+ +----------+----------+----------+----------+
116114"""
117115```
118116
0 commit comments