Hi devs,
For the following XWiki Syntax 2.1 input:
|=head11|=head12
|cell11|cell12
We generate the following XHTML 1.0 output:
<table>
<tbody>
<tr>
<th>head11</th>
<th>head12</th>
</tr>
<tr>
<td>cell11</td>
<td>cell12</td>
</tr>
</tbody>
</table>
I think it would be better to generate:
<table>
<thead>
<tr>
<th>head11</th>
<th>head12</th>
</tr>
</thead>
<tbody>
<tr>
<td>cell11</td>
<td>cell12</td>
</tr>
</tbody>
</table>
Arguments:
* More standard.
* In addition I read I the XHTML spec that "Table rows may be grouped into a
table head, table foot, and one or more table body sections, using the thead,
tfoot and tbody elements, respectively. This division enables user agents to
support scrolling of table bodies independently of the table head and foot.
When long tables are printed, the table head and foot information may be
repeated on each page that contains table data.”
I haven’t checked but hopefully it should relatively painless for our CSS
(unless we use a rule for tbody/tr/th instead of tr/th or th). However even if
it changes our CSS I still fee it’s the right thing to do with a note in the
Release Notes for the unlikely chances that it would break something.
Note tat
I know that for example for the
http://extensions.xwiki.org/xwiki/bin/view/Extension/Datatables+Macro
extension, we cannot use xwiki syntax because of this issue (this is why the
example is using the html macro).
WDYT?
Thanks
-Vincent
PS: our XHTML parser already supports this as can be verified with the
following test:
{{groovy}}
def input = '''
<table>
<thead>
<tr>
<th>head11</th>
<th>head12</th>
</tr>
</thead>
<tbody>
<tr>
<td>cell11</td>
<td>cell12</td>
</tr>
</tbody>
</table>
'''
def xdom = services.rendering.parse(input, 'xhtml/1.0')
println "{{{"
println services.rendering.render(xdom, 'xwiki/2.1')
println "}}}"
{{/groovy}}