You need to sign in to do that
Don't have an account?

How to use rowspan attribute of dataTable column?
Hi All,
I'm using dataTable component to visualize statistic data. Simple example is here:
I would like to merge in column "Land" such cells like 'DACH' or 'UK' with the empty cells below.
I've tried to set rowspan attribute of "Land" column:
<apex:dataTable value="{!Acc2}" var="acc" id="theTable" rowClasses="odd,odd,even,even" border="1" cellpadding="5" cellspacing="1" styleClass="tableClass" bgcolor="lightyellow" >
<apex:column rowspan="2">
<apex:facet name="header">Land</apex:facet>
<I><apex:outputText value="{!acc.Land}"/> </I>
</apex:column>
and got the following result where empty cells shift right:
As dataset for table the list of custom classes is provided.
Do you have any ideas how it can be implemented?
Thank you in advance,
Kostja
I think the problem here is that you are always rendering a land column with a rowspan of 2 for each element in the list. Assuming you have four elements in the list, you'll end up with land aspect trying to span 8 rows in a four row table.
Try changing to the following:
I think this should work, but I'm not 100% sure as I've not conditionally rendered cells in this way before.
All Answers
I think the problem here is that you are always rendering a land column with a rowspan of 2 for each element in the list. Assuming you have four elements in the list, you'll end up with land aspect trying to span 8 rows in a four row table.
Try changing to the following:
I think this should work, but I'm not 100% sure as I've not conditionally rendered cells in this way before.
Hi,
Thank you very much. Now it works.
I don't use
,because then column title is also not shown, I write 'x' to empty cells of land variable and use:
Best regards,
Kostja
Hi, I'm facing the same problem about column title in a PageBlockTable. When I rowspan the first column the column title is not appearing:
Can y help ASAP? Thanks in Advance
Joao