|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--sdsu.html.HTMLTable
Implements an HTML table. This allows displaying of items in rows and columns.
Here is an example of an HTML table with: border size 2, a Caption, centered,
width at 70%, the first row and column set as headers.
Row 0 (zero) is declared | to be | a header | |
---|---|---|---|
Column 0 is a | Cell 1,1 | Cell 1, 2 | Cell 1, 2 |
header | Cell 1,1 |
Constructor Summary | |
HTMLTable(int numberOfRows,
int numberOfColumns)
Create a new table with given number of rows and columns. |
|
HTMLTable(Table initialTableElements)
Create a new html table with element given by the sdsu.util.Table |
Method Summary | |
void |
alignCenter()
Centers the table in the page. |
void |
alignLeft()
Left justifies the table. |
void |
alignRight()
Right justifies the table. |
java.lang.String |
elementAt(int row,
int column)
Returns the string version of the object in table at given row and column. |
void |
makeColumnAHeader(int column)
Makes the given column a header for the rows of table. |
void |
makeRowAHeader(int row)
Makes the given row a header for the columns of table. |
void |
setBorderWidth(int pixelWidth)
Sets the width of the border drawn around table and indivitual cells. |
void |
setCaption(Formatter caption)
Sets text caption displayed above the table. |
void |
setElementAt(HTML data,
int row,
int column)
Places string representation of data in table at given row and column |
void |
setElementAt(java.lang.Object data,
int row,
int column)
Places string representation of data in table at given row and column |
void |
setWidth(int pixelWidth)
Suggests a width in pixels of the table. |
void |
setWidthPercent(int percentOfWindowWidth)
Suggests a width for the table in percent of window width. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
equals,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
Constructor Detail |
public HTMLTable(int numberOfRows, int numberOfColumns)
numberOfRows
- number of rows in the tablenumberOfColumns
- number of colums in the tablepublic HTMLTable(Table initialTableElements)
initialTableElements
- table containing the initial elements for
the html tableMethod Detail |
public void alignCenter()
public void alignRight()
public void alignLeft()
public void setBorderWidth(int pixelWidth)
pixelWidth
- width of border in pixelspublic void setCaption(Formatter caption)
caption
- displayed above tablepublic void makeRowAHeader(int row)
row
- index of the row to be the headerpublic void makeColumnAHeader(int column)
column
- index of the column to be the headerpublic void setElementAt(HTML data, int row, int column) throws java.lang.ArrayIndexOutOfBoundsException
data
- HTML object whose string representation is added to the tablepublic void setElementAt(java.lang.Object data, int row, int column) throws java.lang.ArrayIndexOutOfBoundsException
data
- Item whose string representation is added to the table,
special characters are escaped for youpublic void setWidth(int pixelWidth)
pixelWidth
- suggested width of the table in pixels.public void setWidthPercent(int percentOfWindowWidth)
percentOfWindowWidth
- int between 0 and 100public java.lang.String elementAt(int row, int column) throws java.lang.ArrayIndexOutOfBoundsException
public java.lang.String toString()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |