public ITable AddTable(int width, int[] columnWidths, s.TableStyle style, t.TrackingInfo trackingInfo) { Table table = new Table(width, columnWidths, style, trackingInfo); _content.Add(table); return(table); }
public Table(int width, int[] columnWidths, s.TableStyle style, t.TrackingInfo trackingInfo) { _width = width; _columnWidths = columnWidths; _style = style; _rows = new List <TableRow>(); _trackingInfo = trackingInfo; }
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); } }