C# Класс Novacode.Table

Represents a Table in a document.
Наследование: InsertBeforeOrAfter
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
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

Приватные методы

Метод Описание
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

Описание методов

DeleteAndShiftCellsLeft() публичный Метод

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
Результат void

GetBorder() публичный Метод

Get a table border Added by lckuiper @ 20101117
public GetBorder ( TableBorderType borderType ) : Novacode.Border
borderType TableBorderType The table border to get
Результат Novacode.Border

GetColumnWidth() публичный Метод

Gets the column width for a given column index.
public GetColumnWidth ( Int32 index ) : Double
index System.Int32
Результат Double

InsertColumn() публичный Метод

Insert a column to the right of a Table.
public InsertColumn ( ) : void
Результат void

InsertColumn() публичный Метод

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)
Результат void

InsertPageBreakAfterSelf() публичный Метод

Insert a page break after a Table.
public InsertPageBreakAfterSelf ( ) : void
Результат void

InsertPageBreakBeforeSelf() публичный Метод

Insert a page break before a Table.
public InsertPageBreakBeforeSelf ( ) : void
Результат void

InsertParagraphAfterSelf() публичный Метод

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.
Результат Paragraph

InsertParagraphAfterSelf() публичный Метод

Insert a new Paragraph after this Table.
public InsertParagraphAfterSelf ( string text ) : Paragraph
text string The initial text for this new Paragraph.
Результат Paragraph

InsertParagraphAfterSelf() публичный Метод

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?
Результат Paragraph

InsertParagraphAfterSelf() публичный Метод

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.
Результат Paragraph

InsertParagraphBeforeSelf() публичный Метод

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.
Результат Paragraph

InsertParagraphBeforeSelf() публичный Метод

Insert a new Paragraph before this Table.
public InsertParagraphBeforeSelf ( string text ) : Paragraph
text string The initial text for this new Paragraph.
Результат Paragraph

InsertParagraphBeforeSelf() публичный Метод

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?
Результат Paragraph

InsertParagraphBeforeSelf() публичный Метод

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.
Результат Paragraph

InsertRow() публичный Метод

Insert a row at the end of this table.
public InsertRow ( ) : Row
Результат Row

InsertRow() публичный Метод

Insert a copy of a row at the end of this table.
public InsertRow ( Row row ) : Row
row Row
Результат Row

InsertRow() публичный Метод

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.
Результат Row

InsertRow() публичный Метод

Insert a row into this table.
public InsertRow ( int index ) : Row
index int Index to insert row at.
Результат Row

InsertTableAfterSelf() публичный Метод

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
Результат Table

InsertTableAfterSelf() публичный Метод

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.
Результат Table

InsertTableBeforeSelf() публичный Метод

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
Результат Table

InsertTableBeforeSelf() публичный Метод

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.
Результат Table

MergeCellsInColumn() публичный Метод

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
Результат void

Remove() публичный Метод

Remove this Table from this document.
public Remove ( ) : void
Результат void

RemoveColumn() публичный Метод

Remove the last column for this Table.
public RemoveColumn ( ) : void
Результат void

RemoveColumn() публичный Метод

Remove a column from this Table.
public RemoveColumn ( int index ) : void
index int The column to remove.
Результат void

RemoveRow() публичный Метод

Remove the last row from this Table.
public RemoveRow ( ) : void
Результат void

RemoveRow() публичный Метод

Remove a row from this Table.
public RemoveRow ( int index ) : void
index int The row to remove.
Результат void

SetBorder() публичный Метод

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
Результат void

SetColumnWidth() публичный Метод

Sets the column width for the given index.
public SetColumnWidth ( Int32 index, Double width ) : void
index System.Int32 Column index
width Double Colum width
Результат void

SetDirection() публичный Метод

Set the direction of all content in this Table.
public SetDirection ( Direction direction ) : void
direction Direction (Left to Right) or (Right to Left)
Результат void

SetTableCellMargin() публичный Метод

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.
Результат void

SetWidths() публичный Метод

public SetWidths ( float widths ) : void
widths float
Результат void

SetWidthsPercentage() публичный Метод

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.
Результат void