private void RenderTable(TableLayout layout, IContentContainer container) { int[] columnWidths = layout.ColumnWidths; ITable table = container.AddTable( layout.Bounds.Width, columnWidths, (s.TableStyle)layout.Style, layout.TrackingInfo); foreach (TableRowLayout row in layout.SubLayouts) { RenderTableRow(row, table); } }
private void RenderPhotoTable(PhotoTableLayout layout, IContentContainer container) { // Create a table s.TableStyle tableStyle = null; if (layout.Style != null) { s.PhotoStyle photoStyle = (s.PhotoStyle)layout.Style; tableStyle = new s.TableStyle { Border = photoStyle.Border, Padding = photoStyle.Padding }; } int columnWidth = layout.Bounds.Width / layout.NumColumns; int[] columnWidths = new int[layout.NumColumns]; for (int x = 0; x < columnWidths.Length; ++x) { columnWidths[x] = columnWidth; } ITable table = container.AddTable(layout.Bounds.Width, columnWidths, tableStyle, layout.TrackingInfo); // Create a table row for each photo row foreach (PhotoRowLayout photoRow in layout.SubLayouts) { s.TableRowStyle rowStyle = null; if (photoRow.Style != null) { s.PhotoStyle photoStyle = (s.PhotoStyle)photoRow.Style; rowStyle = new s.TableRowStyle { BackColor = photoRow.BackgroundColor, Padding = photoStyle.Padding }; } ITableRow tableRow = table.AddRow(rowStyle, photoRow.TrackingInfo); RenderPhotoRow(photoRow, tableRow); } }