MCPcopy Create free account
hub / github.com/astanin/python-tabulate / _align_cell_veritically

Function _align_cell_veritically

tabulate/__init__.py:2588–2598  ·  view source on GitHub ↗
(text_lines, num_lines, column_width, row_alignment)

Source from the content-addressed store, hash-verified

2586
2587
2588def _align_cell_veritically(text_lines, num_lines, column_width, row_alignment):
2589 delta_lines = num_lines - len(text_lines)
2590 blank = [" " * column_width]
2591 if row_alignment == "bottom":
2592 return blank * delta_lines + text_lines
2593 elif row_alignment == "center":
2594 top_delta = delta_lines // 2
2595 bottom_delta = delta_lines - top_delta
2596 return top_delta * blank + text_lines + bottom_delta * blank
2597 else:
2598 return text_lines + blank * delta_lines
2599
2600
2601def _append_multiline_row(

Callers 1

_append_multiline_rowFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected