public class Rows
extends com.aspose.ms.System.Collections.CollectionBase
Represents a collection of Row
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.setColumnWidths ( "70 2cm"); Row row1 = table1.getRows().add(); Cell cell1Row1 = row1.getCells().add("ColumnsSpan = 2"); cell1Row1.setColumnsSpan ( 2); cell1Row1.setBorder ( new BorderInfo((int)BorderSide.All,0.5F)); Row row2 = table1.getRows().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 |
---|
Rows()
Initializes a new instance of the
Rows class. |
Rows(Table newParentTable)
Initializes a new instance of the
Rows class. |
Modifier and Type | Method and Description |
---|---|
Row |
add()
Initializes a new instance of the
Row class and add it to the Rows collection. |
void |
add(Row row)
Adds a new
Row object into the collection. |
void |
copyTo(Row[] rowArray,
int index)
Copies the elements to a
Row object array, starting at a specified array index. |
Row |
get_Item(int index)
Gets or sets a
Row object from the collection according to Row index. |
Row |
get_Item(String rowID)
Gets or sets a
Row object from the collection according to Row ID. |
int |
indexOf(Row row)
Gets the index of a specified row in the collection.
|
void |
insert(int index,
Row row)
Inserts a new
Row object into the collection at specified position. |
void |
insert(Row rowToInsertAfter,
Row newRow)
Inserts a new
Row object into the collection after specified Cell object. |
void |
remove(Row rowToRemove)
Removes a
Row object from the collection. |
void |
set_Item(int index,
Row value) |
void |
set_Item(String rowID,
Row value) |
public Rows()
Initializes a new instance of the Rows
class.
public Rows(Table newParentTable)
Initializes a new instance of the Rows
class.
public void add(Row row)
Adds a new Row
object into the collection.
row
- The Row
object to be added.public Row add()
Initializes a new instance of the Row
class and add it to the Rows collection.
Row
object.public Row get_Item(int index)
Gets or sets a Row
object from the collection according to Row 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, Row value)
public Row get_Item(String rowID)
Gets or sets a Row
object from the collection according to Row ID.
public void insert(int index, Row row)
Inserts a new Row
object into the collection at specified position.
index
- The zero-based index at which Row
object should be inserted.row
- The Row
object to be inserted.public void insert(Row rowToInsertAfter, Row newRow)
Inserts a new Row
object into the collection after specified Cell object.
rowToInsertAfter
- The Row
object to insert after.newRow
- The Row
object to be inserted.public int indexOf(Row row)
Gets the index of a specified row in the collection.
row
- The specified row.public void remove(Row rowToRemove)
Removes a Row
object from the collection.
rowToRemove
- The Row
object to be romoved.public void copyTo(Row[] rowArray, int index)
Copies the elements to a Row
object array, starting at a specified array index.
rowArray
- The Row
object array.index
- The start index.Copyright © 2014 Aspose. All Rights Reserved.