Beispiel #1
0
        public Table(decimal width = 1000, int indentation = 0, short marginLeft = 0, short marginRight = 0)
        {
            _Table = new _Table();
            _TableProperties _tp = new _TableProperties();

            _TableWidth _tw = new _TableWidth()
            {
                Width = width.ToString(), Type = _TableWidthUnitValues.Dxa
            };

            _tp.Append(_tw);

            _TableIndentation _ti = new _TableIndentation()
            {
                Width = indentation, Type = _TableWidthUnitValues.Dxa
            };

            _tp.Append(_ti);

            _TableCellMarginDefault _md = new _TableCellMarginDefault();
            _TableCellLeftMargin    _lm = new _TableCellLeftMargin()
            {
                Width = marginLeft, Type = _TableWidthValues.Dxa
            };
            _TableCellRightMargin _rm = new _TableCellRightMargin()
            {
                Width = marginRight, Type = _TableWidthValues.Dxa
            };

            _md.Append(_lm);
            _md.Append(_rm);

            _Table.Append(_tp);
        }
        internal TableCellMarginDefault(DocumentFormat.OpenXml.Wordprocessing.TableCellMarginDefault tableCellMarginDefault)
        {
            this.tableCellMarginDefault = tableCellMarginDefault;

            TopMargin.Type    = TableWidthUnitValue.Nil;
            LeftMargin.Type   = TableWidthValue.Nil;
            BottomMargin.Type = TableWidthUnitValue.Nil;
            RightMargin.Type  = TableWidthValue.Nil;
        }