Table of Contents

Class OdfTable

Namespace
OdfKit.Text
Assembly
OdfKit.dll

Represents a table in a text document. 表示文字文件中的表格。

public class OdfTable
Inheritance
OdfTable
Inherited Members

Constructors

OdfTable(OdfNode, int, int, TextDocument)

Initializes a new instance of the OdfTable class. 初始化 OdfTable 類別的新執行個體。

public OdfTable(OdfNode node, int rows, int cols, TextDocument doc)

Parameters

node OdfNode

The OdfNode of the table. / 表格的 OdfNode 節點。

rows int

The table row count. / 表格列數。

cols int

The table column count. / 表格欄數。

doc TextDocument

The owning text document. / 所屬的文字文件。

Methods

AddNestedTable(int, int, int, int)

Adds a nested table within the specified cell. 在指定儲存格中新增巢狀表格。

public OdfTable AddNestedTable(int row, int col, int nestedRows, int nestedCols)

Parameters

row int

The cell row index. / 儲存格列索引。

col int

The cell column index. / 儲存格欄索引。

nestedRows int

The nested table row count. / 巢狀表格列數。

nestedCols int

The nested table column count. / 巢狀表格欄數。

Returns

OdfTable

The created nested table object. / 建立的巢狀表格物件。

DeleteColumns(int)

Short overload of DeleteColumns that accepts position; remaining optional parameters use defaults and forward to the full overload. 便利多載:提供 position;其餘可選參數使用預設值並轉呼叫最長 DeleteColumns 多載。

public void DeleteColumns(int position)

Parameters

position int

DeleteColumns(int, int)

Deletes columns at the specified position; records a table:deletion if change tracking is enabled. 刪除指定位置的欄;若啟用追蹤修訂則記錄 table:deletion

public void DeleteColumns(int position, int count)

Parameters

position int

The zero-based start column index. / 以 0 為基準的起始欄索引。

count int

The number of columns to delete. / 要刪除的欄數。

DeleteRows(int)

Short overload of DeleteRows that accepts position; remaining optional parameters use defaults and forward to the full overload. 便利多載:提供 position;其餘可選參數使用預設值並轉呼叫最長 DeleteRows 多載。

public void DeleteRows(int position)

Parameters

position int

DeleteRows(int, int)

Deletes rows at the specified position; records a table:deletion if change tracking is enabled. 刪除指定位置的列;若啟用追蹤修訂則記錄 table:deletion

public void DeleteRows(int position, int count)

Parameters

position int

The zero-based start row index. / 以 0 為基準的起始列索引。

count int

The number of rows to delete. / 要刪除的列數。

GetCell(int, int)

Gets the specified cell object. 取得指定的儲存格物件。

public OdfTableCell GetCell(int row, int col)

Parameters

row int

The row index. / 列索引。

col int

The column index. / 欄索引。

Returns

OdfTableCell

The corresponding cell instance. / 對應的儲存格執行個體。

InsertColumns(int)

Short overload of InsertColumns that accepts position; remaining optional parameters use defaults and forward to the full overload. 便利多載:提供 position;其餘可選參數使用預設值並轉呼叫最長 InsertColumns 多載。

public void InsertColumns(int position)

Parameters

position int

InsertColumns(int, int)

Inserts columns at the specified position; records a table:insertion if change tracking is enabled. 於指定位置插入欄;若啟用追蹤修訂則記錄 table:insertion

public void InsertColumns(int position, int count)

Parameters

position int

The zero-based insertion column index. / 以 0 為基準的插入欄索引。

count int

The number of columns to insert. / 要插入的欄數。

InsertRows(int)

Short overload of InsertRows that accepts position; remaining optional parameters use defaults and forward to the full overload. 便利多載:提供 position;其餘可選參數使用預設值並轉呼叫最長 InsertRows 多載。

public void InsertRows(int position)

Parameters

position int

InsertRows(int, int)

Inserts rows at the specified position; records a table:insertion if change tracking is enabled. 於指定位置插入列;若啟用追蹤修訂則記錄 table:insertion

public void InsertRows(int position, int count)

Parameters

position int

The zero-based insertion row index. / 以 0 為基準的插入列索引。

count int

The number of rows to insert. / 要插入的列數。

MergeCells(int, int, int, int)

Merges cells in the table. 合併表格中的儲存格。

public void MergeCells(int startRow, int startCol, int rowSpan, int colSpan)

Parameters

startRow int

The start row index. / 起始列索引。

startCol int

The start column index. / 起始欄索引。

rowSpan int

The number of rows spanned. / 橫跨的列數。

colSpan int

The number of columns spanned. / 橫跨的欄數。

SetCellStyle(int, int, string)

Sets the style name of the specified cell. 設定指定儲存格的樣式名稱。

public void SetCellStyle(int row, int col, string styleName)

Parameters

row int

The cell row index. / 儲存格列索引。

col int

The cell column index. / 儲存格欄索引。

styleName string

The style name. / 樣式名稱。

SetColumnWidth(int, OdfLength)

Sets the width of the specified column. 設定指定欄的欄寬。

public void SetColumnWidth(int col, OdfLength width)

Parameters

col int

The column index. / 欄位索引。

width OdfLength

The column width value. / 欄寬值。

SetRowRepeat(int, int)

Sets the repeat count of the specified row. 設定指定列的重複次數。

public void SetRowRepeat(int row, int repeatCount)

Parameters

row int

The row index. / 列索引。

repeatCount int

The repeat count. / 重複次數。