Home  Products  Purchase  Downloads  Demos  Forums  Blogs  Ticket  Wiki  API  Corporate

com.aspose.pdf.elements
Class Table

java.lang.Object
  extended bycom.aspose.pdf.elements.PdfElementBase
      extended bycom.aspose.pdf.elements.Paragraph
          extended bycom.aspose.pdf.elements.Table
All Implemented Interfaces:
java.lang.Cloneable

public class Table
extends Paragraph

Represents a table Paragraph in a Pdf document.


Constructor Summary
Table(Section section)
          Initialize a new instance of the Table class.
 
Method Summary
 Color getBackgroundColor()
          Gets Color object that indicates the background color of the table.
 float[] getColumnWidths()
          Gets a string that contains the width of each columns in this table.
 int getDefaultCellAlignmentType()
          Gets a default AlignmentType that indicates the cell alignment type.
 BorderInfo getDefaultCellBorder()
          Gets a BorderInfo object that indicates the default border style for all cells in this table.
 MarginInfo getDefaultCellPadding()
          Gets a MarginInfo object that indicates the default cell padding in the table.
 TextInfo getDefaultCellTextInfo()
          Gets a TextInfo object that indicates the default cell text format info.
 org.w3c.dom.Element getDOMElement()
          Gets a DOM representation of the pdf element.
 Rows getRows()
          Gets a Rows collection that indicates all rows in the table.
 void setBackgroundColor(Color color)
          Sets a Color object that indicates the background color of the table.
 void setColumnWidths(float[] widths)
          Sets a string that contains the width of each columns in this table.
 void setDefaultCellAlignmentType(int type)
          Sets a default AlignmentType that indicates the cell alignment type.
 void setDefaultCellBorder(BorderInfo cellBorder)
          Sets a BorderInfo object that indicates the default border style for all cells in this table.
 void setDefaultCellPadding(MarginInfo cellPadding)
          Sets a MarginInfo object that indicates the default cell padding in the table.
 void setDefaultCellTextInfo(TextInfo defaultCellTextInfo)
          Sets a TextInfo object that indicates the default cell text format info.
 
Methods inherited from class com.aspose.pdf.elements.Paragraph
clone, getMargin, isDisabled, isFirstParagraph, isKeptTogether, isOnOddPage, setDisabled, setFirstParagraph, setKeptTogether, setMargin, setOnOddPage
 
Methods inherited from class com.aspose.pdf.elements.PdfElementBase
getElementFactory, getID, getNameIndex, setID
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Table

public Table(Section section)
Initialize a new instance of the Table class.

 [SampleCode]
 Pdf pdf = new Pdf();
 Section sec1 = pdf.getSections().add();
 Table table = new Table(sec1);
 table.setColumnWidths(new float[]{150,150});
 Row row1 = new Row(table);
 table.getRows().add(row1);
 Text someText = new Text(sec1,"some text");
 Cell cell11 = new Cell(table);
 cell11.getParagraphs().add(someText);
 row1.getCells().add(cell11);
 Text otherText = new Text(sec1,"some more text");
 Cell cell12 = new Cell(table);
 cell12.getParagraphs().add(otherText);
 row1.getCells().add(cell12);
 

Parameters:
section - The section that owns the Table paragraph.
Method Detail

getRows

public Rows getRows()
Gets a Rows collection that indicates all rows in the table.


getDefaultCellPadding

public MarginInfo getDefaultCellPadding()
Gets a MarginInfo object that indicates the default cell padding in the table.


setDefaultCellPadding

public void setDefaultCellPadding(MarginInfo cellPadding)
Sets a MarginInfo object that indicates the default cell padding in the table.


getBackgroundColor

public Color getBackgroundColor()
Gets Color object that indicates the background color of the table.


setBackgroundColor

public void setBackgroundColor(Color color)
Sets a Color object that indicates the background color of the table.

Parameters:
color - The backgroundColor to set.

getDefaultCellAlignmentType

public int getDefaultCellAlignmentType()
Gets a default AlignmentType that indicates the cell alignment type. Default value is AlignmentType.Left.


setDefaultCellAlignmentType

public void setDefaultCellAlignmentType(int type)
Sets a default AlignmentType that indicates the cell alignment type.


getDefaultCellBorder

public BorderInfo getDefaultCellBorder()
Gets a BorderInfo object that indicates the default border style for all cells in this table.


setDefaultCellBorder

public void setDefaultCellBorder(BorderInfo cellBorder)
Sets a BorderInfo object that indicates the default border style for all cells in this table.


getDefaultCellTextInfo

public TextInfo getDefaultCellTextInfo()
Gets a TextInfo object that indicates the default cell text format info.


setDefaultCellTextInfo

public void setDefaultCellTextInfo(TextInfo defaultCellTextInfo)
Sets a TextInfo object that indicates the default cell text format info.

Parameters:
defaultCellTextInfo - The Default Cell TextInfo to set.

getColumnWidths

public float[] getColumnWidths()
Gets a string that contains the width of each columns in this table.
The value of each column should be separated by blank.The unit is point,

Returns:
Returns the column Width as array.

setColumnWidths

public void setColumnWidths(float[] widths)
Sets a string that contains the width of each columns in this table.
The value of each column should be separated by blank.The unit is point,

Parameters:
widths - The column Widths to set.

getDOMElement

public org.w3c.dom.Element getDOMElement()
                                  throws AsposeBaseException
Description copied from class: PdfElementBase
Gets a DOM representation of the pdf element.

Overrides:
getDOMElement in class Paragraph
Throws:
AsposeBaseException
See Also:
PdfElementBase.getDOMElement()