org.apache.poi.xwpf.usermodel
Class XWPFTable

java.lang.Object
  extended by org.apache.poi.xwpf.usermodel.XWPFTable

public class XWPFTable
extends java.lang.Object

Sketch of XWPFTable class. Only table's text is being hold.

Specifies the contents of a table present in the document. A table is a set of paragraphs (and other block-level content) arranged in rows and columns.

Author:
Yury Batrakov (batrakov at gmail.com)

Field Summary
protected  java.lang.StringBuffer text
           
 
Constructor Summary
XWPFTable(XWPFDocument doc, org.openxmlformats.schemas.wordprocessingml.x2006.main.CTTbl table)
           
XWPFTable(XWPFDocument doc, org.openxmlformats.schemas.wordprocessingml.x2006.main.CTTbl table, int row, int col)
           
 
Method Summary
 void addNewCol()
          add a new column for each row in this table
 void addNewRowBetween(int start, int end)
           
 XWPFTableRow createRow()
          create a new XWPFTableRow object with as many cells as the number of columns defined in that moment
 org.openxmlformats.schemas.wordprocessingml.x2006.main.CTTbl getCTTbl()
           
 int getNumberOfRows()
           
 XWPFTableRow getRow(int pos)
           
 java.lang.String getText()
           
 int getWidth()
           
 void setWidth(int width)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

text

protected java.lang.StringBuffer text
Constructor Detail

XWPFTable

public XWPFTable(XWPFDocument doc,
                 org.openxmlformats.schemas.wordprocessingml.x2006.main.CTTbl table,
                 int row,
                 int col)

XWPFTable

public XWPFTable(XWPFDocument doc,
                 org.openxmlformats.schemas.wordprocessingml.x2006.main.CTTbl table)
Method Detail

getCTTbl

@Internal
public org.openxmlformats.schemas.wordprocessingml.x2006.main.CTTbl getCTTbl()
Returns:
ctTbl object

getText

public java.lang.String getText()
Returns:
text

addNewRowBetween

public void addNewRowBetween(int start,
                             int end)

addNewCol

public void addNewCol()
add a new column for each row in this table


createRow

public XWPFTableRow createRow()
create a new XWPFTableRow object with as many cells as the number of columns defined in that moment

Returns:
tableRow

getRow

public XWPFTableRow getRow(int pos)
Parameters:
pos - - index of the row
Returns:
the row at the position specified or null if no rows is defined or if the position is greather than the max size of rows array

setWidth

public void setWidth(int width)
Parameters:
width -

getWidth

public int getWidth()
Returns:
width value

getNumberOfRows

public int getNumberOfRows()
Returns:
number of rows in table


Copyright 2009 The Apache Software Foundation or its licensors, as applicable.