-
-
+
+
' % \
- (self.tns, self.tns, cellStyle, self.tns, span)
- self.res += '<%sp %sstyle-name="%s">%s%sp>' % \
- (self.txns, self.txns, paraStyle, cgi.escape(str(content)),
- self.txns)
- self.res += '%stable-cell>' % self.tns
+ if not self.html:
+ self.res += '<%stable-cell %sstyle-name="%s" ' \
+ '%snumber-columns-spanned="%d">' % \
+ (self.tns, self.tns, cellStyle, self.tns, span)
+ self.res += '<%sp %sstyle-name="%s">%s%sp>' % \
+ (self.txns, self.txns, paraStyle,
+ cgi.escape(str(content)), self.txns)
+ self.res += '%stable-cell>' % self.tns
+ else:
+ tag = header and 'th' or 'td'
+ self.res += '<%s colspan="%d">%s%s>' % \
+ (tag, span, cgi.escape(str(content)), tag)
def startRow(self):
- self.res += '<%stable-row>' % self.tns
+ if not self.html:
+ self.res += '<%stable-row>' % self.tns
+ else:
+ self.res += ' | '
def endRow(self):
- self.res += '%stable-row>' % self.tns
+ if not self.html:
+ self.res += '%stable-row>' % self.tns
+ else:
+ self.res += ' '
def startTable(self):
- self.res += '<%stable %sname="%s">' % (self.tns, self.tns, self.name)
- self.res += '<%stable-column %snumber-columns-repeated="%d"/>' % \
- (self.tns, self.tns, self.nbOfCols)
+ if not self.html:
+ self.res += '<%stable %sname="%s">' % (self.tns, self.tns,
+ self.name)
+ self.res += '<%stable-column %snumber-columns-repeated="%d"/>' % \
+ (self.tns, self.tns, self.nbOfCols)
+ else:
+ css = ''
+ if self.name: css = ' class="%s"' % self.name
+ self.res += '' % css
def endTable(self):
- self.res += '%stable>' % self.tns
+ if not self.html:
+ self.res += '%stable>' % self.tns
+ else:
+ self.res += ' '
def dumpFloat(self, number):
return str(round(number, 2))
def get(self):
'''Returns the whole table.'''
- return self.res.decode('utf-8')
+ if self.html:
+ return self.res
+ else:
+ return self.res.decode('utf-8')
# ------------------------------------------------------------------------------
|