Returns the given cell padded with spaces to the max_cell_length.
You may choose the alignment of the cell contents:
0 : align left
1 : align right
2 : center
In case the cell contents is longer than max_cell_length, the contents
gets truncated. You may choose to not truncate any cell data.
Definition at line 94 of file fancyTab.py.
95 """Returns the given cell padded with spaces to the max_cell_length.
96 You may choose the alignment of the cell contents:
102 In case the cell contents is longer than max_cell_length, the contents
103 gets truncated. You may choose to not truncate any cell data.
106 if max_cell_length == 0:
108 cur_cell_length=len(cell)
109 padding=max_cell_length-cur_cell_length
114 return cell[:max_cell_length]
120 return cell +
" " * padding
123 return " " * padding + cell
126 pl =
int(math.ceil(padding / 2.0))
128 return " " * pl + cell +
" " * pr