|
Class: Table (in HTML)
Object
|
+--HTML::AbstractElement
|
+--HTML::AbstractHTMLElement
|
+--HTML::Table
- Package:
- stx:goodies/webServer/htmlTree
- Category:
- Net-Documents-HTML-ModelTree-Table
- Version:
- rev:
1.41
date: 2022/07/05 18:11:42
- user: cg
- file: HTML__Table.st directory: goodies/webServer/htmlTree
- module: stx stc-classLibrary: htmlTree
HTML table object
[instance variables:]
-
[class variables:]
-
copyrightCOPYRIGHT (c) 2003 by eXept Software AG
All Rights Reserved
This software is furnished under a license and may be used
only in accordance with the terms of that license and with the
inclusion of the above copyright notice. This software may not
be provided or otherwise made available to, or used by, any
other person. No title to or ownership of the software is
hereby transferred.
required protocol
-
tagName
-
interface-attributes
-
bgcolor: aColorSpec
-
-
cellPadding
-
Return the cellpadding of the table.
The cellpadding is the spacing within the cells.
-
cellPadding: aLength
-
Set the cellpadding of the table.
The cellpadding is the spacing within the cells.
-
cellSpacing
-
Return the cellspacing of the table.
The cellspacing is the spacing between the cells.
-
cellSpacing: aLength
-
Set the cellspacing of the table..
The cellspacing is the spacing between the cells.
-
cellpadding
-
Return the cellpadding of the table.
The cellpadding is the spacing within the cells.
-
cellpadding: aLength
-
Set the cellpadding of the table.
The cellpadding is the spacing within the cells.
-
cellspacing
-
Return the cellspacing of the table.
The cellspacing is the spacing between the cells.
-
cellspacing: aLength
-
Set the cellspacing of the table..
The cellspacing is the spacing between the cells.
-
height
-
Return the height of the table.
-
height: aNumberOrPercentString
-
Set the height of the table.
-
summary
-
Return a text with purpose and structure of table.
-
summary: aStringOrText
-
Set a text with purpose and structure of table.
-
vspace: verticalSpace
-
Set the vertical spacing (space above and below) of the table.
-
width
-
Return the width of the table.
-
width: aNumberOrPercentString
-
set the width of the table.
interface-attributes-frame
-
frame
-
Return the frame of the table.
The frame is the outer borders.
Possible frame types are:
void, above, below, hsides,
lh, rhs, vsides, box, border
-
frame: aFrameType
-
Set the frame of the table.
The frame is the outer borders.
Possible frame types are:
void, above, below, hsides,
lh, rhs, vsides, box, border
-
frameAbove
-
Set frame to be at above.
The frame is the outer borders.
-
frameBelow
-
Set frame to be at below.
The frame is the outer borders.
-
frameBorder
-
Set the frame to be border.
The frame is the outer borders.
-
frameBox
-
Set the frame to be as box.
The frame is the outer borders.
-
frameHorizontalSides
-
Set the frame to be at horizontal sides.
The frame is the outer borders.
-
frameLeftHorizontalSide
-
Set frame to be at left horizontal sides.
The frame is the outer borders.
-
frameRightHorizontalSide
-
Set frame to be at right horizontal side.
The frame is the outer borders.
-
frameVerticalSides
-
Set the frame to be at vertical sides.
The frame is the outer borders.
interface-attributes-rules
-
beRulesAll
-
Set rules to be rows.
The rules are the inner borders.
-
beRulesColumns
-
Set rules to be columns.
The rules are the inner borders.
-
beRulesGroups
-
Set rules to be groups.
The rules are the inner borders.
-
beRulesNone
-
Set rules to have no rules.
The rules are the inner borders.
-
beRulesRows
-
Set rules to be rows.
The rules are the inner borders.
-
rules
-
Return the rules of the table.
The rules are the inner borders.
Possible frame types are:
none, groups, rows, cols, all
-
rules: aRuleType
-
Set the rules of the table.
The rules are the inner borders.
Possible frame types are:
none, groups, rows, cols, all
interface-elements
-
caption
-
Return the caption of the table.
The caption is the heading of a table.
-
caption: aCaptionOrString
-
Set the caption of the table.
The caption is the heading of a table.
You can set a caption element or a simple string.
-
foot
-
Return the foot of the table.
-
foot: aFoot
-
Set the table foot.
A foot can be a ready built table foot, a simple string to be wrapped
by a table foot or a collection of heading cells or strings to be the
foot cells of the head.
-
head
-
Return the head of the table.
-
head: aHead
-
Set the table head. The head is the heading or headline of the table.
A head can be a ready built table head, a simple string to be wrapped
by a table head or a collection of heading cells or strings to be the
heading cells of the head.
interface-elements-body
-
addBody
-
Build an empty body and
add it to the children.
-
addBody: aTableBodyOrString
-
Add a table body to the children of this table.
The passed table body can be a ready built table body,
a simple string to be wrapped in a body, or a collection
of table rows. These table rows can be either ready built
table rows or simple strings too.
-
body
-
Return a default body,
it is the first body found.
If no body can be found nil.
-
bodyAt: anIndex
-
Return an existing body at the given index or nil.
interface-elements-cell
-
bodyAt: aBodyIndex rowAt: aRowIndex cellAt: aCellIndex
-
Find a cell by the given indices.
Return nil if one of the indices doesn't exist.
-
bodyAt: aBodyIndex rowAt: aRowIndex cellAt: aCellIndex put: aBodyOrString
-
Set a cell at the given indices.
The cell can be a cell element
or a simple string.
-
cellAt: aCellIndexPoint
-
Find a cell by the given indices.
Return nil if one of the indices doesn't exist.
-
cellAt: anIndexPoint put: aBodyOrString
-
Set a cell at the given index.
The cell can be a cell element
or a simple string.
-
rowAt: aRowIndex cellAt: aCellIndex
-
Find a cell by the given indices.
Return nil if one of the indices doesn't exist.
-
rowAt: aRowIndex cellAt: aCellIndex put: aBodyOrString
-
Set a cell at the given indices.
The cell can be a cell element
or a simple string.
interface-elements-foot
-
footCellAt: aCellIndex
-
Return the head cell at a cell index.
-
footCellAt: aCellIndex put: aHeadingCellOrString
-
Set the head cell at a cell index.
interface-elements-head
-
headCellAt: aCellIndex
-
Return the head cell at a cell index.
-
headCellAt: aCellIndex put: aHeadingCellOrString
-
Set the head cell at a cell index.
interface-elements-row
-
addRow
-
Build a new empty table row.
-
addRow: aTableRow
-
Add a table row to the children of this table.
The passed table row can be a ready built table row,
a simple string to be wrapped in a row, or a collection
of data cells. These data cells can be either ready built
data cells or simple strings too.
-
bodyAt: aBodyIndex rowAt: aRowIndex
-
Find a row by the given indices.
Return nil if one of the indices doesn't exist.
-
bodyAt: aBodyIndex rowAt: aRowIndex put: aBodyOrString
-
Set a row at the given indices.
-
rowAt: anIndex
-
Try to find a row at the given index.
Look first in a body if one exists,
then look at the children for direct rows.
private-accessing
-
getBody
-
Return a body to add rows.
If no body exists, build one.
-
getBodyAt: aBodyIndex
-
Return a body at the given index.
If not exists build one.
-
getCaption
-
Return a caption.
If no caption exists, build one.
-
getFoot
-
Return a head to add head cells.
If no head exists, build one.
-
getHead
-
Return a head to add head cells.
If no head exists, build one.
queries
-
canHaveChild: anElement in: aParser
-
self halt.
-
canHaveText
-
(comment from inherited method)
return true, if I allow text as child (i.f. PCDATA)
required-visiting
-
acceptHTMLVisitor: aVisitor
-
visitor pattern: dispatch me to the visitor
-
subelementsDo: aOneArgumentBlock
-
Execute a one argument block additionally for caption, head and foot
testing
-
isBlockElement
-
-
isTable
-
Building a table:
|table|
table := Table new.
table border: 1.
table caption: 'This is the caption of a generated table'.
table head: #('Hans' 'Otto' 'Karl' 'Kurt' 'Gerd' 'John' 'Bert').
table addRow: #(373 937 363 836 217 832 234).
table addRow: #(945 123 534 345 563 343 342).
table foot: #(111 222 333 444 555 666 777).
table htmlString.
|
Accessing a single cell:
|table cell|
table := HTML::Table new.
table addBody: #( #(678 212 131 200 344)
#(312 567 112 678 120)
#(177 314 234 189 789)).
cell := table cellAt:3@2.
cell bgColor:Color red.
|
|