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

42.6. CensusCell.fo()

This method generates a table-cell element containing a block element. The logic that decides what text will appear is Section 42.4, “CensusCell._display(). For styling, see Section 13.11.10, “FO_CENSUS_CELL_ATTRS.

cbchistlib.py
# - - -   C e n s u s C e l l . f o

    def fo(self, s, **kw):
        '''Render self as XSL-FO.
        '''
        #-- 1
        # [ text  :=  self displayed as a comma-separated list of
        #             the nonzero count categories in self ]
        text = self._display()

        #-- 2
        # [ s  +:=  an open table-cell element styled with
        #           FO_CENSUS_CELL_ATTRS and kw
        #   cell  :=  that element ]
        cell = s.start('table-cell', FO_CENSUS_CELL_ATTRS, kw)

        #-- 3
        # [ s  +:=  a block element containing text, right-aligned ]
        s.leaf('block', FO_ALIGN_RIGHT, text)

        #-- 4
        cell.end()