Row and Cell Span

Row and Cell Span

Forum member · Nov 14, 2011
Is the table heading layout below possible with the Generator? |------------------------------------------------| | | | header | | | header | header |----------|----------| header | | | | header | header | | |------------------------------------------------|

Re: Row and Cell Span

Support · Nov 14, 2011
Hello, You can set the row and column span values when you add the cell to the CellList. Here is the list of overloads for CellList.Add method and refer to the second and third overloads in the list that takes the integer values of colspan and rowspan. Thanks, ceTe Software Support Team.

Re: Row and Cell Span

Forum member · Nov 15, 2011
That doesn't work. The last column does not span the two rows. Dim MyTable As Table2 = New Table2(0, 0, 900, 600) MyTable.CellDefault.Align = TextAlign.Center MyTable.CellDefault.VAlign = VAlign.Center MyTable.Border.LineStyle = LineStyle.Solid MyTable.Border.Width = 0.1 '' Add columns to the table MyTable.Columns.Add(50) 'Col 1 MyTable.Columns.Add(50) 'Col 2 AND sub col 1 MyTable.Columns.Add(50) 'Col 3 AND sub col 2 MyTable.Columns.Add(50) 'Sub col 3 MyTable.Columns.Add(50) 'Sub col 4 MyTable.Columns.Add(50) 'Total ''Cells that span two rows '' Add rows to the table and add cells to the rows Dim rwHeader As Row2 = MyTable.Rows.Add(0, Font.HelveticaBold, 10, Grayscale.Black, Grayscale.LightGrey) rwHeader.Cells.Add("Col 1", 1, 3) Dim rwHeader1 As Row2 = MyTable.Rows.Add(0, Font.HelveticaBold, 10, Grayscale.Black, Grayscale.LightGrey) rwHeader1.Cells.Add("Col 2", 2, 1) rwHeader1.Cells.Add("Col 3", 2, 1) Dim rwHeader2 As Row2 = MyTable.Rows.Add(0, Font.HelveticaBold, 10, Grayscale.Black, Grayscale.LightGrey) rwHeader2.Cells.Add("sub col 1", 1, 1) rwHeader2.Cells.Add("sub col 2", 1, 1) rwHeader2.Cells.Add("sub col 3", 1, 1) rwHeader2.Cells.Add("sub col 4", 1, 1) rwHeader2.Cells.Add("Total", 1, 2)

Re: Row and Cell Span

Support · Nov 15, 2011
Hello, Please try adding the "Total" column to the first row and set the row span to 2. This should work for you. Below is the modified code for it. Dim MyTable As Table2 = New Table2(0, 0, 900, 600) MyTable.CellDefault.Align = TextAlign.Center MyTable.CellDefault.VAlign = VAlign.Center MyTable.Border.LineStyle = LineStyle.Solid MyTable.Border.Width = 0.1 '' Add columns to the table MyTable.Columns.Add(50) 'Col 1 MyTable.Columns.Add(50) 'Col 2 AND sub col 1 MyTable.Columns.Add(50) 'Col 3 AND sub col 2 MyTable.Columns.Add(50) 'Sub col 3 MyTable.Columns.Add(50) 'Sub col 4 MyTable.Columns.Add(50) 'Total ''Cells that span two rows '' Add rows to the table and add cells to the rows Dim rwHeader As Row2 = MyTable.Rows.Add(0, Font.HelveticaBold, 10, Grayscale.Black, Grayscale.LightGrey) rwHeader.Cells.Add("Col 1", 1, 3) Dim rwHeader1 As Row2 = MyTable.Rows.Add(0, Font.HelveticaBold, 10, Grayscale.Black, Grayscale.LightGrey) rwHeader1.Cells.Add("Col 2", 2, 1) rwHeader1.Cells.Add("Col 3", 2, 1) rwHeader1.Cells.Add("Total", 1, 2) Dim rwHeader2 As Row2 = MyTable.Rows.Add(0, Font.HelveticaBold, 10, Grayscale.Black, Grayscale.LightGrey) rwHeader2.Cells.Add("sub col 1", 1, 1) rwHeader2.Cells.Add("sub col 2", 1, 1) rwHeader2.Cells.Add("sub col 3", 1, 1) rwHeader2.Cells.Add("sub col 4", 1, 1) Thanks, ceTe Software Support Team.

Re: Row and Cell Span

Forum member · Nov 15, 2011
Aha! Thanks. That worked.