public static GherkinTable BuildTable(List <string> rows, bool haveTrailingRows = true) { GherkinTable table = new GherkinTable(add_last_new_line: haveTrailingRows); int max_columns = 1; foreach (string row_text in rows) { GherkinTableRow row = new GherkinTableRow(); string[] cells = row_text.Split('|'); max_columns = Math.Max(max_columns, cells.Length - 2); for (int i = 1; i < cells.Length - 1; i++) { // create cells except first and last empty string row.Add(new GherkinTableCell(cells[i])); } table.Add(row); } table.PadCells(max_columns); return(table); }
public void Add(GherkinTableRow row) { m_Rows.Add(row); }