public class Cell extends XmlEntityWithInternals implements com.aspose.ms.System.ICloneable
Represents a cell in a Aspose.Pdf.Generator.Table
.
[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.ColumnsSpan = 2; cell1Row1.Border = 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>
Modifier and Type | Field and Description |
---|---|
int |
BackgroundAlignment
Gets or sets a
CellBackgroundAlignment enum that indicates the alignment of the background image. |
Color |
BackgroundColor
Gets or sets a
Aspose.Pdf.Generator.Color object that indicates the background color of the
cell. |
String |
BackgroundImageFile
Gets or sets a string that indicates the background image file name.
|
int |
BackgroundImageType
Gets or sets a
ImageFileType enum that indicates the type of the background image. |
BorderInfo |
Border
Gets or sets a
BorderInfo object that indicates the cell's border info. |
TextInfo |
DefaultCellTextInfo
Gets or sets a
TextInfo object that indicates the default cell text format info. |
float |
FitWidth
Obsolete.Please use Table.ColumnWidths instead.
|
String |
ID
Gets or sets a string that indicates the ID of the cell.
|
boolean |
IsWordWrapped
Gets or sets a boolean value that indicates the alignment type of the cell.
|
MarginInfo |
Padding
Gets or sets a
MarginInfo object that indicates the cell's padding. |
Paragraphs |
Paragraphs
Gets or sets a
Paragraphs collection of paragraphs(ifa any)that are contained in the the cell. |
int |
RowSpan
Gets or sets a int value that indicates how many rows the cell spans.
|
int |
VerticalTextRotationAngle
Gets or sets a
VerticalTextRotationType object that indicates the text rotation
angle in floating box or cells. |
Constructor and Description |
---|
Cell(Row row)
Initializes a new instance of the
Cell class in a table. |
Cell(Table table)
Initializes a new instance of the
Cell class in a table. |
Modifier and Type | Method and Description |
---|---|
void |
addTextAsNewParagraph(String text) |
Object |
completeClone()
Clones a new
Cell object. |
Object |
deepClone()
Clones a new
Cell object. |
int |
getAlignment()
Gets or sets a
AlignmentType object that indicates the alignment type of the cell. |
int |
getColumnsSpan()
Gets or sets an int value that indicates how many columns the cell spans.
|
int |
getVerticalAlignment()
Gets or sets a
Aspose.Pdf.VerticalAlignment object that indicates the vertical alignment type. |
boolean |
isNoBorder()
Gets or sets a bool value that indicates whether the cell have borders.
|
void |
setAlignment(int value) |
void |
setColumnsSpan(int value) |
void |
setFontSizeForTextualChildren(float newFontSize) |
void |
setNoBorder(boolean value) |
void |
setTextNameForTextualChildren(String newFontName) |
void |
setVerticalAlignment(int value) |
load
public BorderInfo Border
Gets or sets a BorderInfo
object that indicates the cell's border info.
public Color BackgroundColor
Gets or sets a Aspose.Pdf.Generator.Color
object that indicates the background color of the
cell.
public String BackgroundImageFile
Gets or sets a string that indicates the background image file name.
public int BackgroundImageType
Gets or sets a ImageFileType
enum that indicates the type of the background image.
public int BackgroundAlignment
Gets or sets a CellBackgroundAlignment
enum that indicates the alignment of the background image.
public MarginInfo Padding
Gets or sets a MarginInfo
object that indicates the cell's padding.
public float FitWidth
Obsolete.Please use Table.ColumnWidths instead. Gets or sets a float value that indicates the fit width of the cell. The unit is point. In XML,the default unit is point,but cm and inch are also supported. For example,FitWidth="2cm" or FitWidth="2inch".
public Paragraphs Paragraphs
Gets or sets a Paragraphs
collection of paragraphs(ifa any)that are contained in the the cell.
public String ID
Gets or sets a string that indicates the ID of the cell.
public TextInfo DefaultCellTextInfo
Gets or sets a TextInfo
object that indicates the default cell text format info.
public int VerticalTextRotationAngle
Gets or sets a VerticalTextRotationType
object that indicates the text rotation
angle in floating box or cells.
public int RowSpan
Gets or sets a int value that indicates how many rows the cell spans.
public boolean IsWordWrapped
Gets or sets a boolean value that indicates the alignment type of the cell.
public Cell(Table table)
Initializes a new instance of the Cell
class in a table.
table
- The Table
object where the cell is in.
public Cell(Row row)
Initializes a new instance of the Cell
class in a table.
row
- The Row
object where the cell is in.public int getColumnsSpan()
Gets or sets an int value that indicates how many columns the cell spans.
public void setColumnsSpan(int value)
public boolean isNoBorder()
Gets or sets a bool value that indicates whether the cell have borders.
public void setNoBorder(boolean value)
public int getVerticalAlignment()
Gets or sets a Aspose.Pdf.VerticalAlignment
object that indicates the vertical alignment type.
public void setVerticalAlignment(int value)
public int getAlignment()
Gets or sets a AlignmentType
object that indicates the alignment type of the cell.
public void setAlignment(int value)
public Object deepClone()
Clones a new Cell
object. This method clones only the format but not contents of the cell.
deepClone
in interface com.aspose.ms.System.ICloneable
Cell
object.public void setTextNameForTextualChildren(String newFontName)
public void setFontSizeForTextualChildren(float newFontSize)
public void addTextAsNewParagraph(String text)
public Object completeClone()
Clones a new Cell
object. This method clones both format and contents of the cell.
Cell
object.Copyright © 2014 Aspose. All Rights Reserved.