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

How to double space rows in VisualForce PDF PageBlockTable
Here is the code that works well but output one line per row. The new requirement is to output a blank row after each data row. Any and all help is appreciated.
<apex:pageBlockTable value="{!sc}" var="u" style="width:100%">
<apex:column >
<apex:image id="theImage" value="/img/checkbox_checked.gif" width="15" height="15"/>
</apex:column>
<apex:column style="width:100%">
<apex:outputText value="{!u.stringConditionsText}" style="width:100%"/>
</apex:column>
</apex:pageBlockTable>
Hey I just used this
And seems working
So the actula code should be
All Answers
I think it will be better if you use apex:repeat for this req.
Hope it helps
<table border="0" >
<tr>
<th>Image</th>
<th>String Conditions</th>
</tr>
<apex:repeat var="cases" value="{!Account.Cases}">
<tr>
<td><apex:image id="theImage" value="/img/checkbox_checked.gif" height="15"/></td>
<td><apex:outputText value="{!u.stringConditionsText}" /></td>
</tr>
<tr>
<td><apex:outputText value=""/></td>
<td><apex:outputText value="" /></td>
</tr>
</apex:repeat>
</table>
If this post is helpful please throw Kudos.If this post solves your problem kindly mark it as solution.
Thanks
Thanks very much for the speedy response. I am getting the double space but the image and the corresponding text are on separate lines. Do you know how I could get both to stay on the same line?
Hello,
I edited the above post. Please see that. See what happens and let me know.
If this post is helpful please throw Kudos.If this post solves your problem kindly mark it as solution.
Thanks
Hello,
Thanks again for all you help. Here is what I have but the data is still displayed on two rows:
<apex:repeat var="u" value="{!sc}">
<table border="0">
<tr>
<th></th>
<th></th>
</tr><tr>
<td style="white-space:nowrap;">
<apex:image id="theImage" value="/img/checkbox_checked.gif" width="15" height="15"/>
<apex:outputText value="{!u.stringConditionsText}" />
</td>
</tr>
<tr>
<td >
<apex:outputText value="" />
</td>
<td>
<apex:outputText value="" />
</td>
</tr>
</table>
</apex:repeat>
Try this
Avi,
Thanks very muich for helping me with this issue. However, your suggested solution did not work. I am still getting the image and text on separate lines.
Thanks
Vibrate
made some minor changes !
Have a look at the screen here https://www.diigo.com/item/image/4279c/9vim
Avi,
I have a lot more text than your example. My text is similar to the following (Imagine this as two seperate lines each prefixed by the image).:
All instruments must be placed in accordance with current NewCode's "Accessibility Policy & Guidelines for
Humanitarian Support locations Along important water ways and by ways".
Waterway repair may require reasonable grind and overlay a minimum of 40' (max. 650') on each side of excavation
as directed by NewCode Senior Engineer.
Thanks,
Vibrate
Do one more thing
assign a fixed width to the TD. well change it according to your need
Avi,
I just setup a Diigo account would it be possible to contact me thru that medium?
Thanks,
Vibrate
Avi,
Here is what I have but the display is still putting the image on a separate line from the text:
<apex:repeat var="u" value="{!sc}">
<table border="0">
<tr>
<th></th>
<th></th>
</tr>
<tr>
<td style="white-space:nowrap;" width="300px">
<div>
<apex:image id="theImage" value="/img/checkbox_checked.gif" width="15" height="15" style="float:left"/>
<apex:outputText value="{!u.stringConditionsText}" style="float:left"/>
<div style="clear:both"/>
</div>
</td>
</tr>
<tr>
<td >
<apex:outputText value="" />
</td>
<td>
<apex:outputText value="" />
</td>
</tr>
</table>
</apex:repeat>
Thanks,
Vibrate
Avi,
I don't know if this is helpful but changing the width makes the text to wrap less/more depending on increasing/decreasing the width.
Thanks,
Vibrate
Avi,
Here is what I have but I am still getting separate lines for the two elements.
<apex:repeat var="u" value="{!sc}">
<table border="0">
<tr>
<th></th>
<th></th>
</tr>
<tr>
<td width="100%" >
<div>
<apex:image id="theImage" value="/img/checkbox_checked.gif" width="15" height="15" style="float:left;"/>
<apex:outputText value="{!u.stringConditionsText}" style="float:left"/>
<div style="clear:both"/>
</div>
</td>
</tr>
<tr>
<td >
<apex:outputText value="" />
</td>
<td>
<apex:outputText value="" />
</td>
</tr>
</table>
</apex:repeat>
Thanks,
Vibrate
Can you post the actual html generated ?
and I asked you to add width to table tag
I moved the width to the table tag with the same result. The output is a PDF. Is there a way to get the HTML output from the PDF output?
Thanks,
Vibrate
Avi,
Here is the HTML:
</table></span></td></tr><tr><td class="data2Col " colSpan="2"><br /></td></tr><tr><td class="data2Col " colSpan="2">
<table border="0" width="100%">
<tr>
<th></th>
<th></th>
</tr>
<tr>
<td>
<div></td></tr><tr><td class="data2Col " colSpan="2"><img id="j_id0:upPDFForm:j_id2:j_id58:j_id63:0:theImage" src="/img/checkbox_checked.gif" height="15px" style="float:left;" width="15px" /></td></tr><tr><td class="data2Col " colSpan="2"><span style="float:left">All instruments must be placed in accordance with current NewCode's "Accessibility Policy & Guidelines for Humanitarian Support locations important water ways and by ways".</span></td></tr><tr><td class="data2Col " colSpan="2">
<div style="clear:both"></div>
</div>
</td>
</tr>
<tr>
<td></td></tr><tr><td class="data2Col " colSpan="2"></td></tr><tr><td class="data2Col " colSpan="2">
</td>
<td></td></tr><tr><td class="data2Col " colSpan="2"></td></tr><tr><td class="data2Col " colSpan="2">
</td>
</tr>
</table></td></tr><tr><td class="data2Col " colSpan="2">
<table border="0" width="100%">
<tr>
<th></th>
<th></th>
</tr>
<tr>
<td>
<div></td></tr><tr><td class="data2Col " colSpan="2"><img id="j_id0:upPDFForm:j_id2:j_id58:j_id63:1:theImage" src="/img/checkbox_checked.gif" height="15px" style="float:left;" width="15px" /></td></tr><tr><td class="data2Col " colSpan="2"><span style="float:left">Waterway repair may require reasonable grind and overlay a minimum of 40' (max. 650')on each side of excavation as directed by NewCode Senior Engineer.</span></td></tr><tr><td class="data2Col " colSpan="2">
<div style="clear:both"></div>
</div>
</td>
</tr>
<tr>
<td></td></tr><tr><td class="data2Col " colSpan="2"></td></tr><tr><td class="data2Col " colSpan="2">
</td>
<td></td></tr><tr><td class="data2Col " colSpan="2"></td></tr><tr><td class="data2Col last " colSpan="2">
</td>
</tr>
</table>
Thanks,
Vibrate
ou have some problem with the code have a look here
Please check your code. have a look at the above code the image and text are placed in different td.
Well one suggestion try to wrap the table inside a <apex:ouputPanel layout="block">
else if it doesnt work post your visualforce code
You are right the output apex tags seem to be generating additional tr and td tags. The code has both image and text in the same td element but I belive ViduslForce is generating additional tags. I will try using the outputPanel as suggested when I return from my meeting.
Thanks,
Vibrate
Avi,
As you suggested, I wrapped the entire table in the output panel, but it did not make a difference. The image and text are still being displayed on separate lines:
<apex:repeat var="u" value="{!sc}">
<apex:outputPanel id="newPanel" layout="block">
<table border="0" width="100%">
<tr>
<th></th>
<th></th>
</tr>
<tr>
<td >
<div>
<apex:image id="theImage" value="/img/checkbox_checked.gif" width="15px" height="15px" style="float:left;"/>
<apex:outputText value="{!u.stringConditionsText}" style="float:left"/>
<div style="clear:both"/>
</div>
</td>
</tr>
<tr>
<td >
<apex:outputText value="" />
</td>
<td>
<apex:outputText value="" />
</td>
</tr>
</table>
</apex:outputPanel>
</apex:repeat>
Thanks,
Vibrate
What is the exact code in your page ?
Please check if there is any change in the HTML generated ?
Well overlooked the code! I found a conflict!
The repeat tag should be inside the table!
Avi,
Again thanks for alll your help. Here is what I have but I am still getting the output on separate lines:
<apex:outputPanel id="newPanel" layout="block">
<table border="0" width="100%">
<apex:repeat var="u" value="{!sc}">
<tr>
<th></th>
<th></th>
</tr>
<tr>
<td >
<div>
<apex:image id="theImage" value="/img/checkbox_checked.gif" width="15px" height="15px" style="float:left;"/>
<apex:outputText value="{!u.stringConditionsText}" style="float:left"/>
<div style="clear:both"/>
</div>
</td>
</tr>
<tr>
<td >
</td>
<td>
</td>
</tr>
</apex:repeat>
</table>
</apex:outputPanel>
Thanks,
Vibrate
the idea is there are extra td and tr inserted in your page that shouldnt be there!.
I tried this myself and my html came pretty clean, not sure where you are wrong
Avi,
I just want to thank you for your help. I really appreciated the time you spent trying to help me solve this issue. If I find a solution I will make sure to add it to this post.
Thanks,
Vibrate
can you take it out ?
I am not sure what is the code/css there if everything fails you can give it a try
Avi,
I removed the code from inside the "pageBlock" but got the same result as when it was inside the "pageBlock".
Thanks,
Vibrate
Just like last time, the HTML generated is creating two rows, one for the image and one for the text.
Thanks,
Vibrate
Avi,
With this code I don't get the double-spacing but it keeps the image and the text on the same row even though the rows are singled-spaced. In the generated HTML I can see that both items are in the same "tr" tag.
<apex:pageBlockTable value="{!sc}" var="u" style="width:100%">
<apex:column >
<apex:image id="theImage" value="/img/checkbox_checked.gif" width="15" height="15"/>
</apex:column>
<apex:column style="width:100%">
<apex:outputText value="{!u.stringConditionsText}" style="width:100%"/>
</apex:column>
</apex:pageBlockTable>
Thanks,
Vibrate
Hey I just used this
And seems working
So the actula code should be
Avi,
This is doing exactly what I need. YOU ARE THE MANNNN!:
<apex:pageBlock >
<table border="0" width="100%">
<apex:repeat value="{!sc}" var="u">
<tr>
<th> </th>
<th> </th>
</tr>
<tr>
<td style="white-space:nowrap;">
<apex:image id="theImage" value="/img/checkbox_checked.gif" width="15" height="15" style="float:left"/>
</td>
<td>{!u.stringConditionsText}</td>
</tr>
</apex:repeat>
Thanks,
Vibrate