45. class PhysRow: One physical row
cbchistlib.py
# - - - - - c l a s s P h y s R o w
class PhysRow(object):
'''Represents one physical row of a table (vs. logical row).
Exports:
PhysRow(nPhysCols, cssClass=None):
[ nPhysCols is a positive int ->
return a new PhysRow instance with no row label and
(maxPhysCols) columns, all set to SpacerCell
instances, and flagged with class (cssClass) if given ]
.nPhysCols: [ as passed to constructor ]
.setLabel(rowLabel, span):
[ (rowLabel is a RowLabel instance) and
(span is a positive int) ->
self := self with (rowLabel) as its row label,
to span (span) rows when rendered ]
.setCell(k, cell):
[ (0 <= k < self.nPhysCols) and
(cell is a Cell instance) ->
self := self with cell in column [k] ]
.html(sox, rowx):
[ (sox is a sox.Sox instance) and
(rowx is this row's index within the group) ->
sox +:= a tr element representing self as XHTML ]
.fo(sox, rowx):
[ (sox is a sox.Sox instance) and
(rowx is this row's index within the group) ->
sox +:= an XSL-FO table-row element representing self ]
State/Invariants:
._rowLabel: [ self's label as a RowLabel or None ]
._span:
[ number of rows to be spanned when self._rowLabel is not
None ]
._cellList:
[ the cells of self as Cell instances ]
'''