+ Start a Discussion
grigri9grigri9 

rendering VF components to PDF breaks tables

I have the following VF component that is just 2 table rows and a closing table tag.

 

<apex:component controller="pageExClass">
<tr style="" height="80%">
<td height="80%">&nbsp;</td>
<td height="80%">&nbsp;</td>
<td height="80%">&nbsp;</td>
<td height="80%">&nbsp;</td>
<td height="80%">&nbsp;</td>
<td height="80%">&nbsp;</td>
</tr>
<tr>
<td colspan="2" height="35">&nbsp;</td>
<td bgcolor="#c0c0c0" colspan="1" class="txtb big3">Total</td>
<td class="nobr txtb">{!NumMemoItems}</td>
<td colspan="1" height="35">&nbsp;</td>
<td bgcolor="#c0c0c0" colspan="1" class="nobr txtb"><apex:outputField value="{!MemoInfo.Total_Amount__c}"/></td>
</tr>
</table>

</apex:component>

 

 If is use it in a page being rendered to html it properly creates the table and rows like so: html table  if I render to pdf the table is broken like so:  pdf table

 

Copying and pasting the component into the page directly fixes the issue. Does anyone know if there is some html being automatically created when you insert a component?

 

--Greg

 

gtuerkgtuerk

might be grasping at straws, but do you have a stylesheet reference in your page?  The css class selectors you use might not be available in the component without pulling in the stylesheet?  I'm not sure if components inherit styles or not

 

<td class="nobr txtb">

 

grigri9grigri9

Unfortunately that's not it, I tried removing the class attribute from the component and I get the same exact thing (except style classes are not applied obviously.) Also, the class atribute is being applied correctly in both pdf and html.

 

I.E. txtb is making the font bold.

 

--Greg

communitycommunity

</head>