Open tdegeus opened 1 year ago
Looking the source code, the solution is:
import prettytable
tab = prettytable.PrettyTable()
for s in ["a", "b", "c"]:
tab.add_row([s, s])
#tab.add_divider()
if len(tab._dividers) > 0:
tab._dividers[-1] = True
for s in ["1", "2", "3"]:
tab.add_row([s, s])
print(tab.get_string())
Be aware that if code changes, this can break.
Is your feature request related to a problem? Please describe.
I would like to avoid detecting the last item of a loop to add a divider. Therefore I would like to be able to set it separately, see example.
Describe the solution you'd like
Describe alternatives you've considered
Additional context
-