示例#1
0
 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);
 }
示例#2
0
 public void AddHeader(string header)
 {
     Column new_column = new Column();
     new_column.Text = header;
     mColumns.Add(new_column);
 }
示例#3
0
 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);
 }