def get_test_html_from_value(value):
 data = list(value[u'data'])
 table = u'<table>'
 if value[u'first_row_is_table_header']:
  row_header = data.pop(0)
  table += u'<thead><tr>'
  for th in row_header:
   table += (u'<th>%s</th>' % tiny_escape(th))
  table += u'</tr></thead>'
 table += u'<tbody>'
 for row in data:
  table += u'<tr>'
  first = True
  for col in row:
   if (value[u'first_col_is_header'] and first):
    table += (u'<th>%s</th>' % tiny_escape(col))
   else:
    table += (u'<td>%s</td>' % tiny_escape(col))
   first = False
  table += u'</tr>'
 table += u'</tbody></table>'
 return table

def get_test_html_from_value ( value ) : data = list ( value [ u'data' ] ) table = u'<table>' if value [ u'first_row_is_table_header' ] : row_header = data . pop ( 0 ) table += u'<thead><tr>' for th in row_header : table += ( u'<th>%s</th>' % tiny_escape ( th ) ) table += u'</tr></thead>' table += u'<tbody>' for row in data : table += u'<tr>' first = True for col in row : if ( value [ u'first_col_is_header' ] and first ) : table += ( u'<th>%s</th>' % tiny_escape ( col ) ) else : table += ( u'<td>%s</td>' % tiny_escape ( col ) ) first = False table += u'</tr>' table += u'</tbody></table>' return table
generate a test html from a tableblock value .