Exemple #1
0
        private void CreateEmptyTable(CT_Tbl table)
        {
            // MINIMUM ELEMENTS FOR A TABLE
            table.AddNewTr().AddNewTc().AddNewP();

            CT_TblPr tblpro = table.AddNewTblPr();

            if (!tblpro.IsSetTblW())
            {
                tblpro.AddNewTblW().w = "0";
            }
            tblpro.tblW.type = (ST_TblWidth.auto);

            // layout
            tblpro.AddNewTblLayout().type = ST_TblLayoutType.autofit;

            // borders
            CT_TblBorders borders = tblpro.AddNewTblBorders();

            borders.AddNewBottom().val  = ST_Border.single;
            borders.AddNewInsideH().val = ST_Border.single;
            borders.AddNewInsideV().val = ST_Border.single;
            borders.AddNewLeft().val    = ST_Border.single;
            borders.AddNewRight().val   = ST_Border.single;
            borders.AddNewTop().val     = ST_Border.single;


            CT_TblGrid tblgrid = table.AddNewTblGrid();

            tblgrid.AddNewGridCol().w = (ulong)2000;
        }
Exemple #2
0
        private void CreateEmptyTable(CT_Tbl table)
        {
            // MINIMUM ELEMENTS FOR A TABLE
            table.AddNewTr().AddNewTc().AddNewP();

            CT_TblPr tblpro = table.AddNewTblPr();

            if (!tblpro.IsSetTblW())
            {
                tblpro.AddNewTblW().w = "0";
            }
            tblpro.tblW.type = (ST_TblWidth.auto);

            // layout
            // tblpro.AddNewTblLayout().Type=(STTblLayoutType.AUTOFIT);

            // borders
            CT_TblBorders borders = tblpro.AddNewTblBorders();

            borders.AddNewBottom().val  = (ST_Border.single);
            borders.AddNewInsideH().val = (ST_Border.single);
            borders.AddNewInsideV().val = (ST_Border.single);
            borders.AddNewLeft().val    = (ST_Border.single);
            borders.AddNewRight().val   = (ST_Border.single);
            borders.AddNewTop().val     = (ST_Border.single);

            /*
             * CTTblGrid tblgrid=table.AddNewTblGrid();
             * tblgrid.AddNewGridCol().W=(new Bigint("2000"));
             */
            GetRows();
        }
Exemple #3
0
        public void SetInsideVBorder(XWPFBorderType type, int size, int space, String rgbColor)
        {
            CT_TblPr      tblPr = GetTrPr();
            CT_TblBorders ctb   = tblPr.IsSetTblBorders() ? tblPr.tblBorders : tblPr.AddNewTblBorders();
            CT_Border     b     = ctb.IsSetInsideV() ? ctb.insideV : ctb.AddNewInsideV();

            b.val   = (xwpfBorderTypeMap[type]);
            b.sz    = (ulong)size;
            b.space = (ulong)space;
            b.color = (rgbColor);
        }
Exemple #4
0
        public void SetInsideVBorder(XWPFTable.XWPFBorderType type, int size, int space, string rgbColor)
        {
            CT_TblPr      trPr         = this.GetTrPr();
            CT_TblBorders ctTblBorders = trPr.IsSetTblBorders() ? trPr.tblBorders : trPr.AddNewTblBorders();
            CT_Border     ctBorder     = ctTblBorders.IsSetInsideV() ? ctTblBorders.insideV : ctTblBorders.AddNewInsideV();

            ctBorder.val   = XWPFTable.xwpfBorderTypeMap[type];
            ctBorder.sz    = (ulong)size;
            ctBorder.space = (ulong)space;
            ctBorder.color = rgbColor;
        }
Exemple #5
0
        public void SetRightBorder(XWPFBorderType type, int size, int space, String rgbColor)
        {
            CT_TblPr      tblPr = GetTrPr();
            CT_TblBorders ctb   = tblPr.IsSetTblBorders() ? tblPr.tblBorders : tblPr.AddNewTblBorders();
            CT_Border     b     = ctb.right != null ? ctb.right : ctb.AddNewRight();

            b.val   = xwpfBorderTypeMap[type];
            b.sz    = (ulong)size;
            b.space = (ulong)space;
            b.color = (rgbColor);
        }
Exemple #6
0
        private void CreateEmptyTable(CT_Tbl table)
        {
            table.AddNewTr().AddNewTc().AddNewP();
            CT_TblPr ctTblPr = table.AddNewTblPr();

            if (!ctTblPr.IsSetTblW())
            {
                ctTblPr.AddNewTblW().w = "0";
            }
            ctTblPr.tblW.type = ST_TblWidth.auto;
            CT_TblBorders ctTblBorders = ctTblPr.AddNewTblBorders();

            ctTblBorders.AddNewBottom().val  = ST_Border.single;
            ctTblBorders.AddNewInsideH().val = ST_Border.single;
            ctTblBorders.AddNewInsideV().val = ST_Border.single;
            ctTblBorders.AddNewLeft().val    = ST_Border.single;
            ctTblBorders.AddNewRight().val   = ST_Border.single;
            ctTblBorders.AddNewTop().val     = ST_Border.single;
            this.GetRows();
        }