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

42.3. CensusCell.html()
# - - -   C e n s u s C e l l . h t m l

    def html(self, sox, addCss=None):
        '''Render self as a td et.Element.

In addition to the CSS class defined in Section 13.4.15, “CLASS_CENSUS_CELL, additional CSS class names can be passed in via the addCss argument; see Section 4.5, “CSS considerations in page design” for a discussion of how CSS classes for the same element may be generated at different levels.

The ._regular attribute is special: it is always rendered. The other three CensusTotal instances are rendered only if they are not in the initial state. See Section 42.4, “CensusCell._display().
        #-- 1
        # [ text  :=  self displayed as a comma-separated list of
        #             the nonzero count categories in self ]
        text = self._display()

We wrap the text in a td element marked up with the class defined in Section 13.4.15, “CLASS_CENSUS_CELL, plus any additional CSS classes provided by the caller. For the logic that combines multiple CSS class names, see Section 59, “combineCss(): Combine CSS classes from different sources”.
        #-- 3
        # [ sox  +:=  a new td et.Element containing the elements of
        #   textList joined with commas ]
        sox.leaf("td", text, combineCss(CLASS_CENSUS_CELL, addCss))