CssLayoutEngineTable

TheArtOfDev.HtmlRenderer.Core.Dom

Layout engine for tables executing the complex layout of tables with rows/columns/headers/etc.

Constructors

CssLayoutEngineTable(CssBox)

Init.

tableBox

Methods

AssignBoxKinds()

Get the table boxes into the proper fields.

CalculateCountAndWidth() : double

Determine Row and Column Count, and ColumnWidths

CanReduceWidth() : bool

Tells if the columns widths can be reduced, by checking the minimum widths of all cells

CanReduceWidth(int) : bool

Tells if the specified column can be reduced, by checking its minimum width

columnIndex
EnforceMaximumSize()

While table width is larger than it should, and width is reductable. If table max width is limited by we need to lower the columns width even if it will result in clipping

EnforceMinimumSize()

Check for minimum sizes (increment widths if necessary)

GetAvailableCellWidth() : double

Gets the width available for cells

GetAvailableTableWidth() : double

Gets the available width for the whole table. It also sets the value of WidthSpecified

GetCellRealColumnIndex(CssBox, CssBox) : int

Gets the cell column index checking its position and other cells colspans

row
cell
GetCellWidth(int, CssBox) : double

Gets the cells width, taking colspan and being in the specified column

column
b
GetColSpan(CssBox) : int

Gets the colspan of the specified box

b
GetColumnMinWidths() : double[]

Gets the minimum width of each column

GetColumnsMinMaxWidthByContent(bool, Double[], Double[])

Calculate the min and max width for each column of the table by the content in all rows. the min width possible without clipping content the max width the cell content can take without wrapping

onlyNans
if to measure only columns that have no calculated width
minFullWidths
return the min width for each column - the min width possible without clipping content
maxFullWidths
return the max width for each column - the max width the cell content can take without wrapping
GetHorizontalSpacing() : double

Gets the actual horizontal spacing of the table

GetHorizontalSpacing(CssBox) : double

Gets the actual horizontal spacing of the table

GetMaxTableWidth() : double

Gets the available width for the whole table. It also sets the value of WidthSpecified

GetRowSpan(CssBox) : int

Gets the rowspan of the specified box

b
GetSpan(CssBox) : int

Gets the span attribute of the tag of the specified box

b
GetSpannedMinWidth(CssBox, CssBox, int, int) : double

Gets the spanned width of a cell (With of all columns it spans minus one).

GetTableSpacing(CssBox) : double

Get the table cells spacing for all the cells in the table. Used to calculate the spacing the table has in addition to regular padding and borders.

tableBox
the table box to calculate the spacing for

Returns: the calculated spacing

GetVerticalSpacing() : double

Gets the actual vertical spacing of the table

GetWidthSum() : double

Gets the current sum of column widths

InsertEmptyBoxes()

Insert EmptyBoxes for vertical cell spanning.

Layout(RGraphics)

Analyzes the Table and assigns values to this CssTable object. To be called from the constructor

LayoutCells(RGraphics)

Layout the cells by the calculated table layout

g
MeasureWords(CssBox, RGraphics)

Recursively measures words inside the box

box
the box to measure
g
Device to use

Fields

_bodyrows : List<CssBox>

collection of all rows boxes

_columns : List<CssBox>

collection of all columns boxes

_tableBox : CssBox

the main box of the table