The
begin_table
command takes a variable length parameter list as
well as a set of keyword parameters. The variable length parameter
list provide the headings. The keyword parameters provide control
over the layout of the table.
Some of the keywords that we support include:
340: #line 728 "lout_weaver.ipk" 341: def begin_table(self, *headings, **kwds): 342: self._writeline("@Table") 343: if kwds.has_key("caption"): 344: self._writeline(" @Caption{%s}" % self.cvt_text(kwds['caption'])) 345: 346: if kwds.has_key("tag"): 347: self._writeline(" @Tag{%s}" % kwds['tag']) 348: 349: if kwds.has_key("location"): 350: self._writeline(" @Location{%s}" % kwds['location']) 351: 352: self._writeline("{ @Tab") 353: # Run through the rule options and do the right thing 354: 355: for opt in ("above", "below", "side", "between"): 356: if kwds.has_key(opt): 357: self._write("%s{%s} " % (opt, kwds[opt])) 358: self._writeline() 359: 360: numCols = len(headings) 361: colName = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" 362: if numCols > len(colName): 363: print "lout_weaver.begin_table: Using first %d columns" % len(colName) 364: numCols = len(colName) 365: 366: self._write(" @Fmta{") 367: for i in range(numCols): 368: if i > 0: 369: self._write(" ! ") 370: self._write("@Col %s" % colName[i]) 371: self._writeline("}\n{") 372: 373: self._write(" @Rowa ") 374: for i in range(numCols): 375: self._write("%s{@B{%s}} " % (colName[i], 376: self.cvt_text(headings[i]))) 377: self._writeline() 378: return 379: 380: def end_table(self): 381: self._writeline("}}") 382: return