Skip to content

Commit

Permalink
check all cells
Browse files Browse the repository at this point in the history
  • Loading branch information
Hummel37 committed Apr 30, 2024
1 parent 3872936 commit 694e03f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Source/QuestPDF/Elements/Table/Table.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ internal sealed class Table : Element, IStateResettable, IContentDirectionAware

public List<TableColumnDefinition> Columns { get; set; } = new();
public List<TableCell> Cells { get; set; } = new();
public List<TableCell> AllCells { get; set; } = new();

public bool ExtendLastCellsToTableBottom { get; set; }

private bool CacheInitialized { get; set; }
Expand Down Expand Up @@ -157,7 +159,7 @@ private void UpdateColumnsWidth(float availableWidth)
column.Width = column.ConstantSize + column.RelativeSize * widthPerRelativeUnit;
}

var cells = Cells.Where(c => c is { ColumnSpan: 1, RowSpan: 1 });
var cells = AllCells.Where(c => c is { ColumnSpan: 1, RowSpan: 1 });

foreach (var column in Columns.Where(c => c.AllowShrink))
{
Expand Down
4 changes: 4 additions & 0 deletions Source/QuestPDF/Fluent/TableExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,10 @@ internal IElement CreateElement()
{
var container = new Container();

HeaderTable.AllCells = HeaderTable.Cells.Concat(ContentTable.Cells).Concat(FooterTable.Cells).ToList();
ContentTable.AllCells = HeaderTable.AllCells;
FooterTable.AllCells = HeaderTable.AllCells;

ConfigureTable(HeaderTable);
ConfigureTable(ContentTable);
ConfigureTable(FooterTable);
Expand Down

0 comments on commit 694e03f

Please sign in to comment.