• Post Reply Bookmark Topic Watch Topic
  • New Topic

Print new rows in dataTable

 
David Larson
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm using a dataTable and, as you know, each iteration produces a new row. Is there a way to print new rows manually? I tried adding
<pre>
<f:verbatim> <tr> </f:verbatim>
</pre>
but it didn't print.

This is an example of what's being printed:
<pre>
<table id="someId">
<tbody>
<tr>
<td>Some Data</td>
<td>Some More Data</td>
<td>Even More Data</td>
<td>This is also data</td>
</tr>
</tbody>
</table>
</pre>

But I'd like to do something like this:
<pre>
<table id="someId" >
<tbody>
<tr>
<td>Some Data</td>
<td>Some More Data</td>
</tr>
<tr>
<td>Even More Data</td>
<td>This is also data</td>
</tr>
</tbody>
</table>
</pre>

How can I do this....how can I force rows within a dataTable?

Thanks.
 
David Larson
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Oops, that didn't print quite right. Let me try that again.

This is what's being printed using a dataTable:





But I'd like to do something like this (with each iteration being printed on more than one line):

 
Varun Khanna
Ranch Hand
Posts: 1400
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
DataTable has a renderer which takes care of rendering the component in HTML format. You can play around with renderer to render the output the way you want. If you want this functionality for all datatables in your application then no issues, but in case you want just for one or two then you need to ensure that your cutomised renderer does not affects other "normal" datatables.

This would be one of the way to achieve what you want.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!