Exemplo n.º 1
0
        public void calc_horizontal_positions(margins table_borders, border_collapse bc, int bdr_space_x)
        {
            if (bc == border_collapse.separate)
            {
                var left = bdr_space_x;
                for (var i = 0; i < _cols_count; i++)
                {
                    _columns[i].left  = left;
                    _columns[i].right = _columns[i].left + _columns[i].width;
                    left = _columns[i].right + bdr_space_x;
                }
            }
            else
            {
                var left = 0;
                if (_cols_count != 0)
                {
                    left -= Math.Min(table_borders.left, _columns[0].border_left);
                }
                for (var i = 0; i < _cols_count; i++)
                {
                    if (i > 0)
                    {
                        left -= Math.Min(_columns[i - 1].border_right, _columns[i].border_left);
                    }

                    _columns[i].left  = left;
                    _columns[i].right = _columns[i].left + _columns[i].width;
                    left = _columns[i].right;
                }
            }
        }
Exemplo n.º 2
0
        public void calc_vertical_positions(margins table_borders, border_collapse bc, int bdr_space_y)
        {
            if (bc == border_collapse.separate)
            {
                var top = bdr_space_y;
                for (var i = 0; i < _rows_count; i++)
                {
                    _rows[i].top    = top;
                    _rows[i].bottom = _rows[i].top + _rows[i].height;
                    top             = _rows[i].bottom + bdr_space_y;
                }
            }
            else
            {
                var top = 0;
                if (_rows_count != 0)
                {
                    top -= Math.Min(table_borders.top, _rows[0].border_top);
                }
                for (var i = 0; i < _rows_count; i++)
                {
                    if (i > 0)
                    {
                        top -= Math.Min(_rows[i - 1].border_bottom, _rows[i].border_top);
                    }

                    _rows[i].top    = top;
                    _rows[i].bottom = _rows[i].top + _rows[i].height;
                    top             = _rows[i].bottom;
                }
            }
        }
Exemplo n.º 3
0
 public table_cell(table_cell val)
 {
     el         = val.el;
     colspan    = val.colspan;
     rowspan    = val.rowspan;
     width      = val.width;
     height     = val.height;
     min_width  = val.min_width;
     min_height = val.min_height;
     max_width  = val.max_width;
     max_height = val.max_height;
     borders    = val.borders;
 }