public class Cells
extends com.aspose.ms.System.Collections.CollectionBase
Represents a collection of Cell
objects.
[C#] Pdf pdf1 = new Pdf(); Section sec1 = pdf1.Sections.Add(); Aspose.Pdf.Generator.Table table1 = new Aspose.Pdf.Generator.Table(); sec1.Paragraphs.Add(table1); table1.ColumnWidths = "70 2cm"; Row row1 = table1.Rows.Add(); Cell cell1Row1 = row1.Cells.Add("ColumnsSpan = 2"); cell1Row1.ColumnsSpan = 2; cell1Row1.Border = new BorderInfo((int)BorderSide.All,0.5F); Row row2 = table1.Rows.Add(); Cell cell1Row2 = row2.Cells.Add("cell1"); cell1Row2.Border = new BorderInfo((int)BorderSide.All,0.5F); Cell cell2Row2 = row2.Cells.Add("cell2"); cell2Row2.Border = new BorderInfo((int)BorderSide.All,0.5F,new Aspose.Pdf.Generator.Color("Red")); pdf1.Save(...); [Visual Basic] Dim pdf1 As Pdf = New Pdf() Dim sec1 As Section = pdf1.Sections.Add() Dim table1 As Aspose.Pdf.Generator.Table = New Aspose.Pdf.Generator.Table() sec1.Paragraphs.Add(table1) table1.ColumnWidths = "70 2cm" Dim row1 As Row = table1.Rows.Add() Dim cell1Row1 As Cell = row1.Cells.Add("ColumnsSpan = 2") cell1Row1.ColumnsSpan = 2 cell1Row1.Border = New BorderInfo(CType(BorderSide.All, Integer), 0.5) Dim row2 As Row = table1.Rows.Add() Dim cell1Row2 As Cell = row2.Cells.Add("cell1") cell1Row2.Border = New BorderInfo(CType(BorderSide.All, Integer), 0.5) Dim cell2Row2 As Cell = row2.Cells.Add("cell2") cell2Row2.Border = New BorderInfo(CType(BorderSide.All, Integer), 0.5, New Aspose.Pdf.Generator.Color("Red")) pdf1.Save(...) [XML] <Pdf xmlns="Aspose.Pdf"> <Section> <Table ColumnWidths="70 2cm"> <Row> <Cell ColumnsSpan="2"> <Border> <All LineWidth="0.5"></All> </Border> <Text> <Segment>ColumnsSpan = 2</Segment> </Text> </Cell> </Row> <Row> <Cell> <Border> <All LineWidth="0.5"></All> </Border> <Text> <Segment>cell1</Segment> </Text> </Cell> <Cell> <Border> <All LineWidth="0.5" Color="Red"></All> </Border> <Text> <Segment>cell2</Segment> </Text> </Cell> </Row> </Table> </Section> </Pdf>
Constructor and Description |
---|
Cells()
Initializes a new instance of the
Cells class. |
Modifier and Type | Method and Description |
---|---|
Cell |
add()
Initializes a new instance of the
Cell class and add it to the Cells collection. |
void |
add(Cell cell)
Adds a new
Cell object into the collection. |
Cell |
add(String cellString)
Initializes a new instance of the
Cell class,adds a string to the new cell object
and then add the Cell object to the Cells collection. |
Cell |
add(String cellString,
TextInfo textInfo)
Initializes a new instance of the
Cell class and add it to the Cells collection. |
void |
addCell(Cell cell)
Adds a new
Cell object into the collection. |
void |
appendToCells(Cell cell) |
void |
copyTo(Cell[] cellArray,
int index)
Copies the elements to a cells array, starting at a specified array index.
|
Cell |
get_Item(int index)
Gets or sets a
Cell object from the collection according to cell index. |
Cell |
get_Item(String cellID)
Gets or sets a
Cell object from the collection according to cell ID. |
int |
indexOf(Cell cell)
Gets the index of a specified cell in the collection.
|
void |
insert(Cell cellToInsertAfter,
Cell newCell)
Inserts a new
Cell object into the collection after specified Cell object. |
void |
insert(int index,
Cell cell)
Inserts a new
Cell object into the collection at specified position. |
void |
remove(Cell cellToRemove)
Removes a
Cell object from the collection. |
void |
set_Item(int index,
Cell value) |
void |
set_Item(String cellID,
Cell value) |
public void addCell(Cell cell)
Adds a new Cell
object into the collection.
cell
- The Cell
object to be added.public void add(Cell cell)
Adds a new Cell
object into the collection.
cell
- The Cell
object to be added.public void appendToCells(Cell cell)
public Cell add()
Initializes a new instance of the Cell
class and add it to the Cells collection.
Cell
objectpublic Cell add(String cellString)
Initializes a new instance of the Cell
class,adds a string to the new cell object
and then add the Cell object to the Cells collection.
cellString
- The string to be added to the cell.Cell
object.public Cell add(String cellString, TextInfo textInfo)
Initializes a new instance of the Cell
class and add it to the Cells collection.
Adds a string with specified text format to the new cell.
cellString
- The string to be added to the cell.textInfo
- The TextInfo object that contains text format informationCell
object.public Cell get_Item(int index)
Gets or sets a Cell
object from the collection according to cell index.
get_Item
in interface com.aspose.ms.System.Collections.IList
get_Item
in class com.aspose.ms.System.Collections.CollectionBase
public void set_Item(int index, Cell value)
public Cell get_Item(String cellID)
Gets or sets a Cell
object from the collection according to cell ID.
public void insert(int index, Cell cell)
Inserts a new Cell
object into the collection at specified position.
index
- The zero-based index at which Cell
object should be inserted.cell
- The Cell
object to be inserted.public void insert(Cell cellToInsertAfter, Cell newCell)
Inserts a new Cell
object into the collection after specified Cell object.
cellToInsertAfter
- The Cell
object to insert after.newCell
- The Cell
object to be inserted.public void remove(Cell cellToRemove)
Removes a Cell
object from the collection.
cellToRemove
- The Cell
object to be romoved.public void copyTo(Cell[] cellArray, int index)
Copies the elements to a cells array, starting at a specified array index.
cellArray
- The cells array.index
- The start index.public int indexOf(Cell cell)
Gets the index of a specified cell in the collection.
cell
- The specified Cell
object.Copyright © 2016 Aspose. All Rights Reserved.