C# Class Novacode.Table

Represents a Table in a document.
Inheritance: InsertBeforeOrAfter
Show file Open project: WordDocX/DocX Class Usage Examples

Public Methods

Method Description
DeleteAndShiftCellsLeft ( int rowIndex, int celIndex ) : void

Deletes a cell in a row

GetBorder ( TableBorderType borderType ) : Novacode.Border

Get a table border Added by lckuiper @ 20101117

GetColumnWidth ( Int32 index ) : Double

Gets the column width for a given column index.

InsertColumn ( ) : void

Insert a column to the right of a Table.

InsertColumn ( int index, bool direction ) : void

Insert a column into a table.

InsertPageBreakAfterSelf ( ) : void

Insert a page break after a Table.

InsertPageBreakBeforeSelf ( ) : void

Insert a page break before a Table.

InsertParagraphAfterSelf ( Paragraph p ) : Paragraph

Insert a Paragraph after this Table, this Paragraph may have come from the same or another document.

InsertParagraphAfterSelf ( string text ) : Paragraph

Insert a new Paragraph after this Table.

InsertParagraphAfterSelf ( string text, bool trackChanges ) : Paragraph

Insert a new Paragraph after this Table.

InsertParagraphAfterSelf ( string text, bool trackChanges, Formatting formatting ) : Paragraph

Insert a new Paragraph after this Table.

InsertParagraphBeforeSelf ( Paragraph p ) : Paragraph

Insert a Paragraph before this Table, this Paragraph may have come from the same or another document.

InsertParagraphBeforeSelf ( string text ) : Paragraph

Insert a new Paragraph before this Table.

InsertParagraphBeforeSelf ( string text, bool trackChanges ) : Paragraph

Insert a new Paragraph before this Table.

InsertParagraphBeforeSelf ( string text, bool trackChanges, Formatting formatting ) : Paragraph

Insert a new Paragraph before this Table.

InsertRow ( ) : Row

Insert a row at the end of this table.

InsertRow ( Row row ) : Row

Insert a copy of a row at the end of this table.

InsertRow ( Row row, int index ) : Row

Insert a copy of a row into this table.

InsertRow ( int index ) : Row

Insert a row into this table.

InsertTableAfterSelf ( Table t ) : Table

Insert a new Table after this Table, this Table can be from this document or another document.

InsertTableAfterSelf ( int rowCount, int columnCount ) : Table

Insert a new Table into this document after this Table.

InsertTableBeforeSelf ( Table t ) : Table

Insert a new Table before this Table, this Table can be from this document or another document.

InsertTableBeforeSelf ( int rowCount, int columnCount ) : Table

Insert a new Table into this document before this Table.

MergeCellsInColumn ( int columnIndex, int startRow, int endRow ) : void

Merge cells in given column starting with startRow and ending with endRow.

Added by arudoy patch: 11608

Remove ( ) : void

Remove this Table from this document.

RemoveColumn ( ) : void

Remove the last column for this Table.

RemoveColumn ( int index ) : void

Remove a column from this Table.

RemoveRow ( ) : void

Remove the last row from this Table.

RemoveRow ( int index ) : void

Remove a row from this Table.

SetBorder ( TableBorderType borderType, Novacode.Border border ) : void

Set a table border Added by lckuiper @ 20101117

SetColumnWidth ( Int32 index, Double width ) : void

Sets the column width for the given index.

SetDirection ( Direction direction ) : void

Set the direction of all content in this Table.

SetTableCellMargin ( TableCellMarginType type, double margin ) : void

Set the specified cell margin for the table-level.

More information can be found here

SetWidths ( float widths ) : void
SetWidthsPercentage ( float widthsPercentage, float totalWidth ) : void

Set Table column width by prescribing percent

Private Methods

Method Description
AddCellToRow ( Row row, System.Xml.Linq.XElement cell, int index, bool direction ) : void

Adds a cell to the right or left of a cell

GetOrCreate_tblPr ( ) : System.Xml.Linq.XElement

If the tblPr element doesent exist it is created, either way it is returned by this function.

InsertRow ( List content, Int32 index ) : Row
Table ( DocX document, System.Xml.Linq.XElement xml ) : System

Method Details

DeleteAndShiftCellsLeft() public method

Deletes a cell in a row
public DeleteAndShiftCellsLeft ( int rowIndex, int celIndex ) : void
rowIndex int index of the row you want to remove the cell
celIndex int index of the cell you want to remove
return void

GetBorder() public method

Get a table border Added by lckuiper @ 20101117
public GetBorder ( TableBorderType borderType ) : Novacode.Border
borderType TableBorderType The table border to get
return Novacode.Border

GetColumnWidth() public method

Gets the column width for a given column index.
public GetColumnWidth ( Int32 index ) : Double
index System.Int32
return Double

InsertColumn() public method

Insert a column to the right of a Table.
public InsertColumn ( ) : void
return void

InsertColumn() public method

Insert a column into a table.
public InsertColumn ( int index, bool direction ) : void
index int The index to insert the column at.
direction bool The side in which you wish to place the colum(True right, false left)
return void

InsertPageBreakAfterSelf() public method

Insert a page break after a Table.
public InsertPageBreakAfterSelf ( ) : void
return void

InsertPageBreakBeforeSelf() public method

Insert a page break before a Table.
public InsertPageBreakBeforeSelf ( ) : void
return void

InsertParagraphAfterSelf() public method

Insert a Paragraph after this Table, this Paragraph may have come from the same or another document.
public InsertParagraphAfterSelf ( Paragraph p ) : Paragraph
p Paragraph The Paragraph to insert.
return Paragraph

InsertParagraphAfterSelf() public method

Insert a new Paragraph after this Table.
public InsertParagraphAfterSelf ( string text ) : Paragraph
text string The initial text for this new Paragraph.
return Paragraph

InsertParagraphAfterSelf() public method

Insert a new Paragraph after this Table.
public InsertParagraphAfterSelf ( string text, bool trackChanges ) : Paragraph
text string The initial text for this new Paragraph.
trackChanges bool Should this insertion be tracked as a change?
return Paragraph

InsertParagraphAfterSelf() public method

Insert a new Paragraph after this Table.
public InsertParagraphAfterSelf ( string text, bool trackChanges, Formatting formatting ) : Paragraph
text string The initial text for this new Paragraph.
trackChanges bool Should this insertion be tracked as a change?
formatting Formatting The formatting to apply to this insertion.
return Paragraph

InsertParagraphBeforeSelf() public method

Insert a Paragraph before this Table, this Paragraph may have come from the same or another document.
public InsertParagraphBeforeSelf ( Paragraph p ) : Paragraph
p Paragraph The Paragraph to insert.
return Paragraph

InsertParagraphBeforeSelf() public method

Insert a new Paragraph before this Table.
public InsertParagraphBeforeSelf ( string text ) : Paragraph
text string The initial text for this new Paragraph.
return Paragraph

InsertParagraphBeforeSelf() public method

Insert a new Paragraph before this Table.
public InsertParagraphBeforeSelf ( string text, bool trackChanges ) : Paragraph
text string The initial text for this new Paragraph.
trackChanges bool Should this insertion be tracked as a change?
return Paragraph

InsertParagraphBeforeSelf() public method

Insert a new Paragraph before this Table.
public InsertParagraphBeforeSelf ( string text, bool trackChanges, Formatting formatting ) : Paragraph
text string The initial text for this new Paragraph.
trackChanges bool Should this insertion be tracked as a change?
formatting Formatting The formatting to apply to this insertion.
return Paragraph

InsertRow() public method

Insert a row at the end of this table.
public InsertRow ( ) : Row
return Row

InsertRow() public method

Insert a copy of a row at the end of this table.
public InsertRow ( Row row ) : Row
row Row
return Row

InsertRow() public method

Insert a copy of a row into this table.
public InsertRow ( Row row, int index ) : Row
row Row Row to copy and insert.
index int Index to insert row at.
return Row

InsertRow() public method

Insert a row into this table.
public InsertRow ( int index ) : Row
index int Index to insert row at.
return Row

InsertTableAfterSelf() public method

Insert a new Table after this Table, this Table can be from this document or another document.
public InsertTableAfterSelf ( Table t ) : Table
t Table The Table t to be inserted
return Table

InsertTableAfterSelf() public method

Insert a new Table into this document after this Table.
public InsertTableAfterSelf ( int rowCount, int columnCount ) : Table
rowCount int The number of rows this Table should have.
columnCount int The number of columns this Table should have.
return Table

InsertTableBeforeSelf() public method

Insert a new Table before this Table, this Table can be from this document or another document.
public InsertTableBeforeSelf ( Table t ) : Table
t Table The Table t to be inserted
return Table

InsertTableBeforeSelf() public method

Insert a new Table into this document before this Table.
public InsertTableBeforeSelf ( int rowCount, int columnCount ) : Table
rowCount int The number of rows this Table should have.
columnCount int The number of columns this Table should have.
return Table

MergeCellsInColumn() public method

Merge cells in given column starting with startRow and ending with endRow.
Added by arudoy patch: 11608
public MergeCellsInColumn ( int columnIndex, int startRow, int endRow ) : void
columnIndex int
startRow int
endRow int
return void

Remove() public method

Remove this Table from this document.
public Remove ( ) : void
return void

RemoveColumn() public method

Remove the last column for this Table.
public RemoveColumn ( ) : void
return void

RemoveColumn() public method

Remove a column from this Table.
public RemoveColumn ( int index ) : void
index int The column to remove.
return void

RemoveRow() public method

Remove the last row from this Table.
public RemoveRow ( ) : void
return void

RemoveRow() public method

Remove a row from this Table.
public RemoveRow ( int index ) : void
index int The row to remove.
return void

SetBorder() public method

Set a table border Added by lckuiper @ 20101117
public SetBorder ( TableBorderType borderType, Novacode.Border border ) : void
borderType TableBorderType The table border to set
border Novacode.Border Border object to set the table border
return void

SetColumnWidth() public method

Sets the column width for the given index.
public SetColumnWidth ( Int32 index, Double width ) : void
index System.Int32 Column index
width Double Colum width
return void

SetDirection() public method

Set the direction of all content in this Table.
public SetDirection ( Direction direction ) : void
direction Direction (Left to Right) or (Right to Left)
return void

SetTableCellMargin() public method

Set the specified cell margin for the table-level.
More information can be found here
public SetTableCellMargin ( TableCellMarginType type, double margin ) : void
type TableCellMarginType The side of the cell margin.
margin double The value for the specified cell margin.
return void

SetWidths() public method

public SetWidths ( float widths ) : void
widths float
return void

SetWidthsPercentage() public method

Set Table column width by prescribing percent
public SetWidthsPercentage ( float widthsPercentage, float totalWidth ) : void
widthsPercentage float column width % list
totalWidth float Total table width. Will be calculated if null sent.
return void