Class TableCell
Represents a cell element within a table.
Implements
Inherited Members
Namespace: IronWord.Models
Assembly: IronWord.dll
Syntax
public class TableCell : TableElement, ITableCell, IWordDocumentObject, IDocumentObject, ICloneable, IParent<IWordDocumentObjectCollection, IWordDocumentObject>
Constructors
TableCell()
Initializes a new instance of the TableCell class.
Declaration
public TableCell()
TableCell(ContentElement[])
Initializes a new instance of the TableCell class with the specified contents.
Declaration
public TableCell(params ContentElement[] contents)
Parameters
| Type | Name | Description |
|---|---|---|
| ContentElement[] | contents | The ContentElement objects representing the initial contents of the cell. |
TableCell(String)
Initializes a new instance of the TableCell class with the specified value.
Declaration
public TableCell(string value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | value | The cell value. |
Properties
BottomMargin
Gets or sets the bottom margin.
Declaration
public Nullable<uint> BottomMargin { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Nullable<System.UInt32> |
Contents
Gets a list of ContentElement objects representing the content of the cell.
Declaration
public List<ContentElement> Contents { get; }
Property Value
| Type | Description |
|---|---|
| System.Collections.Generic.List<ContentElement> |
FitText
Gets or sets the Sets the cell text content feature to fit cell.
Declaration
public bool FitText { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
GridSpan
Gets or sets the Grid span of the table cell.
Declaration
public int GridSpan { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Int32 |
Index
Gets the index of this cell within the parent row's list of children.
Declaration
public int Index { get; }
Property Value
| Type | Description |
|---|---|
| System.Int32 |
LeftMargin
Gets or sets the left margin.
Declaration
public Nullable<uint> LeftMargin { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Nullable<System.UInt32> |
MultiLevelTextLists
Gets a list of all Shape elements contained within this TableCell.
Declaration
public List<MultiLevelTextList> MultiLevelTextLists { get; }
Property Value
| Type | Description |
|---|---|
| System.Collections.Generic.List<MultiLevelTextList> | A List object containing all Shape elements. |
Paragraphs
Gets a list of all Paragraph elements contained within this TableCell.
Declaration
public List<Paragraph> Paragraphs { get; }
Property Value
| Type | Description |
|---|---|
| System.Collections.Generic.List<Paragraph> | A List object containing all Paragraph elements. |
RightMargin
Gets or sets the margin size at the right of the page.
Declaration
public Nullable<uint> RightMargin { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Nullable<System.UInt32> |
Shading
Gets or sets the Sets the color of the shading and fill of the table cell.
Declaration
public IShading Shading { get; set; }
Property Value
| Type | Description |
|---|---|
| IronSoftware.Abstractions.Word.IShading |
Style
The style of the table cell.
Declaration
public TableCellStyle Style { get; set; }
Property Value
| Type | Description |
|---|---|
| TableCellStyle |
TextAlignment
Gets or sets the horizontal alignment of the text content within the cell.
Declaration
public JustificationValues TextAlignment { get; set; }
Property Value
| Type | Description |
|---|---|
| IronSoftware.Abstractions.Word.JustificationValues |
TopMargin
Gets or sets the top margin.
Declaration
public Nullable<uint> TopMargin { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Nullable<System.UInt32> |
Value
Raw value of the cell
Declaration
public string Value { get; }
Property Value
| Type | Description |
|---|---|
| System.String |
VerticalAlignment
Gets or sets the vertical alignment of the content within the cell.
Declaration
public VerticalAlign VerticalAlignment { get; set; }
Property Value
| Type | Description |
|---|---|
| IronSoftware.Abstractions.Word.VerticalAlign |
Width
Gets or sets the width of the table cell, in twips.
Declaration
public Nullable<double> Width { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Nullable<System.Double> |
Methods
AddChild(IWordDocumentObject[])
Adds one or more child content elements to the current content element.
Declaration
public override void AddChild(params IWordDocumentObject[] children)
Parameters
| Type | Name | Description |
|---|---|---|
| IronSoftware.Abstractions.Word.IWordDocumentObject[] | children | The content elements to be added as children. |
Overrides
AddImage(AnyBitmap)
Adds an image to this table cell from an IronSoftware.Drawing.AnyBitmap object.
Declaration
public ImageContent AddImage(AnyBitmap anyBitmap)
Parameters
| Type | Name | Description |
|---|---|---|
| IronSoftware.Drawing.AnyBitmap | anyBitmap |
Returns
| Type | Description |
|---|---|
| ImageContent |
Remarks
The image will be appended to the last paragraph of the table cell.
AddImage(ImageContent)
Adds an image to the table cell.
Declaration
public ImageContent AddImage(ImageContent imageContent)
Parameters
| Type | Name | Description |
|---|---|---|
| ImageContent | imageContent | The Image to be added. |
Returns
| Type | Description |
|---|---|
| ImageContent | The added Image. |
Remarks
The image will be appended to the last paragraph of the table cell.
AddImage(Stream)
Adds an image to the table cell.
Declaration
public ImageContent AddImage(Stream imageStream)
Parameters
| Type | Name | Description |
|---|---|---|
| System.IO.Stream | imageStream | The image stream to be loaded. |
Returns
| Type | Description |
|---|---|
| ImageContent | The added Image. |
Remarks
The image will be appended to the last paragraph of the table cell.
AddImage(String)
Adds an image to the table cell.
Declaration
public ImageContent AddImage(string imagePath)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | imagePath | The physical path of the image to be loaded. |
Returns
| Type | Description |
|---|---|
| ImageContent | The added Image. |
Remarks
The image will be appended to the last paragraph of the table cell.
AddMultiLevelTextList(MultiLevelTextList)
Adds a multi-level text list to the table cell.
Declaration
public MultiLevelTextList AddMultiLevelTextList(MultiLevelTextList multiLevelTextList)
Parameters
| Type | Name | Description |
|---|---|---|
| MultiLevelTextList | multiLevelTextList | The multi-level text list to be added. |
Returns
| Type | Description |
|---|---|
| MultiLevelTextList | The added MultiLevelTextList. |
AddParagraph(Paragraph)
Adds a paragraph to the table cell.
Declaration
public Paragraph AddParagraph(Paragraph paragraph)
Parameters
| Type | Name | Description |
|---|---|---|
| Paragraph | paragraph | The paragraph to be added. |
Returns
| Type | Description |
|---|---|
| Paragraph | The added Paragraph. |
AddShape(ShapeContent)
Adds a shape to the table cell.
Declaration
public ShapeContent AddShape(ShapeContent shapeContent)
Parameters
| Type | Name | Description |
|---|---|---|
| ShapeContent | shapeContent | The Shape to be added. |
Returns
| Type | Description |
|---|---|
| ShapeContent | The added Shape. |
Remarks
The shape will be appended to the last paragraph of the table cell.
AddTable(Table)
Adds a table to the table cell.
Declaration
public Table AddTable(Table table)
Parameters
| Type | Name | Description |
|---|---|---|
| Table | table | The table to be added. |
Returns
| Type | Description |
|---|---|
| Table | The added Table. |
AddText(TextContent)
Adds text to the table cell.
Declaration
public TextContent AddText(TextContent textContent)
Parameters
| Type | Name | Description |
|---|---|---|
| TextContent | textContent | The text to be added. |
Returns
| Type | Description |
|---|---|
| TextContent | The added Text. |
Remarks
The text will be appended to the last paragraph of the table cell.
AddText(String)
Adds text to the table cell.
Declaration
public TextContent AddText(string text)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | text | The text to be added. |
Returns
| Type | Description |
|---|---|
| TextContent | The added Run. |
Remarks
The text will be appended to the last paragraph of the table cell.
CloneStruct()
Creates and returns a new instance of TableCell with the same structure as the current Cell except contents.
Declaration
public TableCell CloneStruct()
Returns
| Type | Description |
|---|---|
| TableCell | A cloned TableCell with the same structure as the current cell with empty content. |
ExtractText()
Declaration
public string ExtractText()
Returns
| Type | Description |
|---|---|
| System.String |
FindText(String)
Declaration
public TextContent FindText(string find)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | find |
Returns
| Type | Description |
|---|---|
| TextContent |
GetWidth(MeasurementUnit)
Gets the width of the TableCell in the specified measurement unit.
Declaration
public double GetWidth(MeasurementUnit measurementUnit)
Parameters
| Type | Name | Description |
|---|---|---|
| MeasurementUnit | measurementUnit | The measurement unit for the width. Default is twentieths of a point (Twips). |
Returns
| Type | Description |
|---|---|
| System.Double | The width of the TableCell in the specified measurement unit. |
InsertCellAfterSelf(ITableCell)
Declaration
public ITableCell InsertCellAfterSelf(ITableCell cell)
Parameters
| Type | Name | Description |
|---|---|---|
| IronSoftware.Abstractions.Word.ITableCell | cell |
Returns
| Type | Description |
|---|---|
| IronSoftware.Abstractions.Word.ITableCell |
InsertCellBeforeSelf(ITableCell)
Declaration
public ITableCell InsertCellBeforeSelf(ITableCell cell)
Parameters
| Type | Name | Description |
|---|---|---|
| IronSoftware.Abstractions.Word.ITableCell | cell |
Returns
| Type | Description |
|---|---|
| IronSoftware.Abstractions.Word.ITableCell |
Remove(TextContent)
Declaration
public bool Remove(TextContent element)
Parameters
| Type | Name | Description |
|---|---|---|
| TextContent | element |
Returns
| Type | Description |
|---|---|
| System.Boolean |
ReplaceText(String, String)
Declaration
public void ReplaceText(string find, string replace)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | find | |
| System.String | replace |
SetContent(ContentElement)
Sets the content of the table cell.
Declaration
public TableCell SetContent(ContentElement content)
Parameters
| Type | Name | Description |
|---|---|---|
| ContentElement | content | The ContentElement to set as the content of the TableCell. |
Returns
| Type | Description |
|---|---|
| TableCell | The modified table cell. |
SetWidth(Double, MeasurementUnit)
Set the width of the TableCell in the specified measurement unit.
Declaration
public TableCell SetWidth(double width, MeasurementUnit measurementUnit)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Double | width | the width of the TableCell. |
| MeasurementUnit | measurementUnit | The measurement unit for the width. Default is twentieths of a point (Twips). |
Returns
| Type | Description |
|---|---|
| TableCell | The width of the TableCell in the specified measurement unit. |
Split(Int32, Int32)
Declaration
public ITableCell Split(int toRow, int toColumn)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | toRow | |
| System.Int32 | toColumn |
Returns
| Type | Description |
|---|---|
| IronSoftware.Abstractions.Word.ITableCell |