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 93 of file fancyTab.py.
94 """Returns the given cell padded with spaces to the max_cell_length.
95 You may choose the alignment of the cell contents:
101 In case the cell contents is longer than max_cell_length, the contents
102 gets truncated. You may choose to not truncate any cell data.
105 if max_cell_length == 0:
107 cur_cell_length=len(cell)
108 padding=max_cell_length-cur_cell_length
113 return cell[:max_cell_length]
119 return cell +
" " * padding
122 return " " * padding + cell
125 pl =
int(math.ceil(padding / 2.0))
127 return " " * pl + cell +
" " * pr