XPTable.Models.Table.GetColumnWidth C# (CSharp) Method

GetColumnWidth() private method

Returns the actual width that this cell can render over (taking colspan into account). Normally its just the width of this column from the column model.
private GetColumnWidth ( int column, Cell cell ) : int
column int
cell Cell
return int
        private int GetColumnWidth(int column, Cell cell)
        {
            ColumnCollection columns = this.ColumnModel.Columns;
            int width = columns[column].Width;

            if (cell.ColSpan > 1)
            {
                // Just in case the colspan goes over the end of the table
                int maxcolindex = Math.Min(cell.ColSpan + column - 1, columns.Count - 1);

                for (int i = column + 1; i <= maxcolindex; i++)
                {
                    width += columns[i].Width;
                }
            }

            return width;
        }
Table