Beispiel #1
0
        public void SetCellMargins(int top, int left, int bottom, int right)
        {
            CT_TblPr      tblPr = GetTrPr();
            CT_TblCellMar tcm   = tblPr.IsSetTblCellMar() ? tblPr.tblCellMar : tblPr.AddNewTblCellMar();

            CT_TblWidth tw = tcm.IsSetLeft() ? tcm.left : tcm.AddNewLeft();

            tw.type = (ST_TblWidth.dxa);
            tw.w    = left.ToString();

            tw      = tcm.IsSetTop() ? tcm.top : tcm.AddNewTop();
            tw.type = (ST_TblWidth.dxa);
            tw.w    = top.ToString();

            tw      = tcm.IsSetBottom() ? tcm.bottom : tcm.AddNewBottom();
            tw.type = (ST_TblWidth.dxa);
            tw.w    = bottom.ToString();

            tw      = tcm.IsSetRight() ? tcm.right : tcm.AddNewRight();
            tw.type = (ST_TblWidth.dxa);
            tw.w    = right.ToString();
        }
Beispiel #2
0
        public void SetCellMargins(int top, int left, int bottom, int right)
        {
            CT_TblPr      trPr         = this.GetTrPr();
            CT_TblCellMar ctTblCellMar = trPr.IsSetTblCellMar() ? trPr.tblCellMar : trPr.AddNewTblCellMar();
            CT_TblWidth   ctTblWidth1  = ctTblCellMar.IsSetLeft() ? ctTblCellMar.left : ctTblCellMar.AddNewLeft();

            ctTblWidth1.type = ST_TblWidth.dxa;
            ctTblWidth1.w    = left.ToString();
            CT_TblWidth ctTblWidth2 = ctTblCellMar.IsSetTop() ? ctTblCellMar.top : ctTblCellMar.AddNewTop();

            ctTblWidth2.type = ST_TblWidth.dxa;
            ctTblWidth2.w    = top.ToString();
            CT_TblWidth ctTblWidth3 = ctTblCellMar.IsSetBottom() ? ctTblCellMar.bottom : ctTblCellMar.AddNewBottom();

            ctTblWidth3.type = ST_TblWidth.dxa;
            ctTblWidth3.w    = bottom.ToString();
            CT_TblWidth ctTblWidth4 = ctTblCellMar.IsSetRight() ? ctTblCellMar.right : ctTblCellMar.AddNewRight();

            ctTblWidth4.type = ST_TblWidth.dxa;
            ctTblWidth4.w    = right.ToString();
        }