6.14.5.18. Tables

Start python section to interscript/weavers/html.py[21 /22 ] Next Prev First Last
   559: #line 616 "html_weaver.ipk"
   560:   def begin_table(self, *headings, **kwds):
   561:     border=kwds.get('border',2)
   562:     tbclass = kwds.get('CLASS','DEFAULT_TABLE_CLASS')
   563:     self._writeline('<TABLE CLASS="'+tbclass+'" COLS="'+str(len(headings))+'" BORDER="'+str(border)+'"><TR>')
   564:     for h in headings:
   565:       self._write('<TH>')
   566:       self.write(h)
   567:       self._write('</TH>')
   568:     self._writeline('</TR>')
   569: 
   570:   def table_row(self,data):
   571:     self._write('<TR>')
   572:     for d in data:
   573:       self._write('<TD VALIGN="TOP">')
   574:       if d:
   575:         lines = string.split(d,'\n')
   576:         for line in lines[:-1]:
   577:           self.write(line)
   578:           self._write('<BR>')
   579:         if len(lines): self.write(lines[-1])
   580:       self._write('</TD>')
   581:     self._writeline('</TR>')
   582: 
   583:   def end_table(self):
   584:     self._writeline('</TABLE>')
   585: 
   586:   def begin_table_row(self):
   587:     self._write('<TR>')
   588: 
   589:   def end_table_row(self):
   590:     self._write('</TR>')
   591: 
   592:   def begin_table_cell(self):
   593:     self._write('<TD>')
   594: 
   595:   def end_table_cell(self):
   596:     self._write('</TD>')
   597: 
End python section to interscript/weavers/html.py[21]