+ Start a Discussion

apex datatable column wrap

Hi there.


I have a datatable where I have 8 columns.

I want 5 columns on one row and the remaining 3 on the next row.

Is this possible?

I would like something like:



<table width="100%"> <tr> <td>Column 1</td> <td>Column 2</td> <td>Column 3</td> <td>Column 4</td> <td>Column 5</td> </tr> <tr> <td colspan="1">Column 6</td> <td colspan="2">Column 7</td> <td colspan="2">Column 8</td> </tr></table>


 Can this be done?

It's an absolute must for me to get my table to fit in 800 X 600 screen size.




Instead of using a dataTable, you could try constructing the table yourself using a repeat tag. See:




So you'd have something like:


<table width="100%">  
<tr><td>Column 1</td><td>Column 2</td><td>Column 3</td><td>Column 4</td><td>Column 5</td></tr>
<tr><td colspan="1">Column 6</td><td colspan="2">Column 7</td><td colspan="2">Column 8</td></tr>
<apex:repeat var="obj" value="{!myObjs}">
<td colspan="2">{!obj.col7}</td>
<td colspan="2">{!obj.col8}</td>



Hi Stephan, thanks for the reply.

This is what I initially did, but I wanted to change over to an apex datatable instead.

Any other ideas greatly welcomed. 


I dont' think this is possible with apex:dataTable. What's about the DIY table approach didn't work as far as your needs?