Posted 5 November 2018, 12:03 pm EST
I’m creating a table with date, changing the width of the columns. Looks like the table it’s been resizes to fill the size of the page. I want to know how to stop that.
RenderTable table = new RenderTable();
table.StretchColumns = StretchTableEnum.None; //= SplitBehaviorEnum.Never ;// = SplitBehaviorEnum.SplitIfNeeded;
int currentRow = table.Rows.Count; table.Style.GridLines.All = new LineDef(Color.DarkGray); ; int r1 = textRow.Split(_tableSep)[0].Split('|').Length; string[] columnText = textRow.Split(_tableSep)[1].Split('|'); columnText = columnText[columnText.Count() - 1] == "" ? columnText.Take(columnText.Length - 1).ToArray() : columnText; string[] justification = textRow.Split(_tableSep)[0].Split('|'); for(int i = 0; i < 11; i++) { table.Cols[i].Width = new Unit(0.3, UnitTypeEnum.Cm); } for (int col = 0; col < columnText.Length; col++) { table.Cells[0, col].Text = string.Format(columnText[col], 0, col); } ra.Children.Add(table);