SharpLeaf Tutorials > Table Tutorials > Filling cells of a Table

Filling cells of a Table

The Table class provides simple methods to input data into table cells.

   tb = new Table();
  // Append along current row
   tb.AddRowCells("Title");
   tb.AddRowCells(new string[]{"Column 1","Column 2","Column 3"});
  // Jump to next row, pointing at column 1
   tb.NextRow(1);
  // Append column from current cell and move on to original row on next column
   tb.AddColumns(new string[]{"Row 1","Row 2","Row 3","Row 4"});
  // Append rows from current cell, and move on to orignal column on next row
   tb.AddRows(new int[][]{new int[]{101,201,301},new int[]{102,202,302}});
  // Jump after the last row that is not empty from column 2 on (no-op here)
   tb.NextEmptyRow(2);
  // Append another row
   tb.AddRows(new string[]{"N/A","N/A","N/A"});
  // Jump after the last row that is not empty from column 1 on (that is completely empty)
   tb.NextEmptyRow(1);
  // Append a new row title
   tb.AddRowCells("Totals");
  // Append the new row's data
   tb.AddRowCells(new int[] {103,403,603});

   lf.IncludeTable(tb);  // Take frame width by default

See also ...

Table Tutorials | SharpLeaf.IncludeTable Method | Table Members


Send comments on this topic
© Dyalog Ltd 2016