function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
VisualforceDevVisualforceDev 

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.

Thanks, 

 

stephanstephan

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

 

http://www.salesforce.com/us/developer/docs/pages/index_Left.htm#StartTopic=Content/pages_compref_repeat.htm

 

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}">
<tr>
<td>{!obj.col1}</td>
<td>{!obj.col2}</td>
<td>{!obj.col3}</td>
<td>{!obj.col4}</td>
<td>{!obj.col5}</td>
</tr>
<tr>
<td>{!obj.col6}</td>
<td colspan="2">{!obj.col7}</td>
<td colspan="2">{!obj.col8}</td>
</tr>
</apex:repeat>
</table>

 

VisualforceDevVisualforceDev

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. 

Regards 

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