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

10.34. hist.cgi: foTableBody()

This function generates the table-body element containing all the census rows.

hist.cgi
# - - -   f o T a b l e B o d y

def foTableBody(s, cbcHist):
    '''Generate the table-body containing the census rows.

      [ (s is a sox.Sox instance) and
        (cbcHist is a lib.CbcHist instance) ->
          s  +:=  a table-body element representing cbcHist's
                  party-hours row and its census rows ]
    '''
    #-- 1
    # [ s  +:=  an open table-body element styled with
    #           FO_TABLE_BODY_ATTRS
    #   body  :=  that element ]
    body = s.start('table-body', lib.FO_TABLE_BODY_ATTRS)

    #-- 2
    # [ s  +:=  cbcHist.partyHoursRow as one or more table-row
    #           elements ]
    cbcHist.partyHoursRow.fo(s, lib.MAX_PHYS_COLS)

    #-- 3
    # [ s  +:=  table-row elements representing the census rows
    #           of cbcHist ]
    for censusRow in cbcHist.genCensusRows():
        censusRow.fo(s, lib.MAX_PHYS_COLS)

    #-- 4
    body.end()