(c_value)
| 508 | else: |
| 509 | # Calculate column widths |
| 510 | def get_width(c_value): |
| 511 | l = 0 |
| 512 | if c_value: |
| 513 | if isinstance(c_value, str): |
| 514 | l = len(c_value) |
| 515 | elif isinstance(c_value, list): |
| 516 | l = max((len(str(x)) for x in c_value if x), default=0) |
| 517 | else: |
| 518 | l = len(str(c_value)) |
| 519 | if l > 50: |
| 520 | l = 50 |
| 521 | return l |
| 522 | |
| 523 | if headers: |
| 524 | widths = [max(len(x), 10) if x else 0 for x in headers] |