public class Cells
extends com.aspose.ms.System.Collections.CollectionBase
Represents a collection of Cell
objects.
[Java] Pdf pdf1 = new Pdf(); Section sec1 = pdf1.getSections().add(); aspose.pdf.generator.Table table1 = new aspose.pdf.generator.Table(); sec1.getParagraphs().add(table1); table1.ColumnWidths = "70 2cm"; Row row1 = table1.getRows().add(); Cell cell1Row1 = row1.getCells().add("ColumnsSpan = 2"); cell1Row1.ColumnsSpan = 2; cell1Row1.Border = new BorderInfo((int)BorderSide.All,0.5F); Row row2 = table1.geRows().add(); Cell cell1Row2 = row2.getCells().add("cell1"); cell1Row2.Border = new BorderInfo((int)BorderSide.All,0.5F); Cell cell2Row2 = row2.getCells().add("cell2"); cell2Row2.Border = new BorderInfo((int)BorderSide.All,0.5F,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 |
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 add(Cell cell)
Adds a new Cell
object into the collection.
cell
- The Cell
object to be added.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 © 2014 Aspose. All Rights Reserved.