C# Class Novacode.Table

Represents a Table in a document.
Inheritance: InsertBeforeOrAfter
Afficher le fichier Open project: WordDocX/DocX Class Usage Examples

Méthodes publiques

Méthode 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

Méthode 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 méthode

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
Résultat void

GetBorder() public méthode

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

GetColumnWidth() public méthode

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

InsertColumn() public méthode

Insert a column to the right of a Table.
public InsertColumn ( ) : void
Résultat void

InsertColumn() public méthode

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)
Résultat void

InsertPageBreakAfterSelf() public méthode

Insert a page break after a Table.
public InsertPageBreakAfterSelf ( ) : void
Résultat void

InsertPageBreakBeforeSelf() public méthode

Insert a page break before a Table.
public InsertPageBreakBeforeSelf ( ) : void
Résultat void

InsertParagraphAfterSelf() public méthode

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.
Résultat Paragraph

InsertParagraphAfterSelf() public méthode

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

InsertParagraphAfterSelf() public méthode

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?
Résultat Paragraph

InsertParagraphAfterSelf() public méthode

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.
Résultat Paragraph

InsertParagraphBeforeSelf() public méthode

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.
Résultat Paragraph

InsertParagraphBeforeSelf() public méthode

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

InsertParagraphBeforeSelf() public méthode

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?
Résultat Paragraph

InsertParagraphBeforeSelf() public méthode

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.
Résultat Paragraph

InsertRow() public méthode

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

InsertRow() public méthode

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

InsertRow() public méthode

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.
Résultat Row

InsertRow() public méthode

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

InsertTableAfterSelf() public méthode

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
Résultat Table

InsertTableAfterSelf() public méthode

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.
Résultat Table

InsertTableBeforeSelf() public méthode

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
Résultat Table

InsertTableBeforeSelf() public méthode

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.
Résultat Table

MergeCellsInColumn() public méthode

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
Résultat void

Remove() public méthode

Remove this Table from this document.
public Remove ( ) : void
Résultat void

RemoveColumn() public méthode

Remove the last column for this Table.
public RemoveColumn ( ) : void
Résultat void

RemoveColumn() public méthode

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

RemoveRow() public méthode

Remove the last row from this Table.
public RemoveRow ( ) : void
Résultat void

RemoveRow() public méthode

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

SetBorder() public méthode

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
Résultat void

SetColumnWidth() public méthode

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

SetDirection() public méthode

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

SetTableCellMargin() public méthode

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.
Résultat void

SetWidths() public méthode

public SetWidths ( float widths ) : void
widths float
Résultat void

SetWidthsPercentage() public méthode

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.
Résultat void