Next / Previous / Contents / TCC Help System / NM Tech homepage

37. class Cell: Base class for table cells

cbchistlib.py
# - - - - -   c l a s s   C e l l

class Cell(object):
    '''Base class for the various table cells.

      Exports:
        Cell():
          [ return a new Cell instance ]
        .html(sox):
          [ sox is a sox.Sox instance ->
              sox  +:=  self, rendered as an XHTML th or td element ]
        .fo(sox, **kw):
          [ (sox is a sox.Sox instance) and
            (kw is a dictionary of XSL-FO attributes ->
              sox  +:=  self, rendered as an XSL-FO table-cell with
                        attributes from kw ]
    '''
    __slots__ = ()
    def __init__(self):
        '''Constructor.
        '''
        pass

    def html(self, sox, addCss=None):
        '''Render as XHTML.
        '''
        raise NotImplementedError("Cell.html() is an abstract class.")

    def fo(self, sox, addCss=None):
        '''Render as XHTML.
        '''
        raise NotImplementedError("Cell.fo() is an abstract class.")