Пример #1
0
 private void AddColumn(XWPFTableRow tabRow, int sizeCol)
 {
     if (sizeCol > 0)
     {
         for (int i = 0; i < sizeCol; i++)
         {
             tabRow.CreateCell();
         }
     }
 }
Пример #2
0
 /**
  * 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();
     }
 }
Пример #3
0
        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();
                    }
                }
            }
        }