private string FillCell(string text, Column column) { if (column.AlignRight == true) return "|" + new string(' ', column.Width - text.Length) + text; else return "|" + text + new string(' ', column.Width - text.Length); }
public void AddHeader(string header) { Column new_column = new Column(); new_column.Text = header; mColumns.Add(new_column); }
private string CenterText(Column column, string text) { int column_width = column.Width; int whitespace = column_width - text.Length; int half = whitespace / 2; int filler = 0; if ((half + half + text.Length) < column_width) filler++; return new string(' ', half) + text + new string(' ', half + filler); }