private void AddColumn(XWPFTableRow tabRow, int sizeCol) { if (sizeCol > 0) { for (int i = 0; i < sizeCol; i++) { tabRow.CreateCell(); } } }
private void AddColumn(XWPFTableRow tabRow, int sizeCol) { if (sizeCol <= 0) { return; } for (int index = 0; index < sizeCol; ++index) { tabRow.CreateCell(); } }
/** * add a new column for each row in this table */ public void AddNewCol() { if (ctTbl.SizeOfTrArray() == 0) { CreateRow(); } for (int i = 0; i < ctTbl.SizeOfTrArray(); i++) { XWPFTableRow tabRow = new XWPFTableRow(ctTbl.GetTrArray(i), this); tabRow.CreateCell(); } }
public XWPFTable(CT_Tbl table, IBody part, int row, int col) : this(table, part) { for (int i = 0; i < row; i++) { XWPFTableRow tabRow = (GetRow(i) == null) ? CreateRow() : GetRow(i); for (int k = 0; k < col; k++) { XWPFTableCell tabCell = (tabRow.GetCell(k) == null) ? tabRow .CreateCell() : null; } } }
public XWPFTable(CT_Tbl table, IBody part, int row, int col) : this(table, part) { for (int pos1 = 0; pos1 < row; ++pos1) { XWPFTableRow xwpfTableRow = this.GetRow(pos1) == null?this.CreateRow() : this.GetRow(pos1); for (int pos2 = 0; pos2 < col; ++pos2) { if (xwpfTableRow.GetCell(pos2) == null) { xwpfTableRow.CreateCell(); } } } }
public XWPFTable(CT_Tbl table, IBody part, int row, int col) : this(table, part) { CT_TblGrid ctTblGrid = table.AddNewTblGrid(); for (int j = 0; j < col; j++) { CT_TblGridCol ctGridCol = ctTblGrid.AddNewGridCol(); ctGridCol.w = 300; } for (int i = 0; i < row; i++) { XWPFTableRow tabRow = (GetRow(i) == null) ? CreateRow() : GetRow(i); for (int k = 0; k < col; k++) { if (tabRow.GetCell(k) == null) { tabRow.CreateCell(); } } } }