code: def to_html(self):
          
          table = '<table%s>\n' % self.html_attributes()
          if self.caption is not None:
              if isinstance(self.caption, MessageElement):
                  caption = self.caption.to_html()
              else:
                  caption = self.caption
              table += '<caption>%s</caption>\n' % caption
          if self.header:
              if isinstance(self.header, MessageElement):
                  header = self.header.to_html()
              else:
                  header = self.header
              table += '<thead>%s</thead>' % header
          table += '<tbody>\n'
          for row in self.rows:
              table += row.to_html()
          table += '</tbody>\n</table>\n'
  
          return table
docs: Render a Table MessageElement as html.
  
          :returns: The html representation of the Table MessageElement
          :rtype: basestring