[pyviews] add thead/tbody to pyvaltable view stable
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Thu, 11 Mar 2010 16:42:13 +0100
branchstable
changeset 4863 f6cf0fcd40ae
parent 4862 0d0e5279f65e
child 4864 e77d3e95872d
[pyviews] add thead/tbody to pyvaltable view
web/views/pyviews.py
--- a/web/views/pyviews.py	Thu Mar 11 16:41:43 2010 +0100
+++ b/web/views/pyviews.py	Thu Mar 11 16:42:13 2010 +0100
@@ -17,18 +17,23 @@
     def call(self, pyvalue, headers=None):
         if headers is None:
             headers = self._cw.form.get('headers')
-        self.w(u'<table class="listing">\n')
+        w = self.w
+        w(u'<table class="listing">\n')
         if headers:
-            self.w(u'<tr>')
+            w(u'<thead>')
+            w(u'<tr>')
             for header in headers:
-                self.w(u'<th>%s</th>' % header)
-            self.w(u'</tr>\n')
+                w(u'<th>%s</th>' % header)
+            w(u'</tr>\n')
+            w(u'</thead>')
+        w(u'<tbody>')
         for row in pyvalue:
-            self.w(u'<tr>')
+            w(u'<tr>')
             for cell in row:
-                self.w(u'<td>%s</td>' % cell)
-            self.w(u'</tr>\n')
-        self.w(u'</table>\n')
+                w(u'<td>%s</td>' % cell)
+            w(u'</tr>\n')
+        w(u'</tbody>')
+        w(u'</table>\n')
 
 
 class PyValListView(View):