You need to sign in to do that
Don't have an account?
gail.hallett
Borders in visualforce pdf page are different thicknesses.
Here is my page header:
<apex:page standardController="Pro_Sale__c" cache="false" standardStylesheets="true" showHeader="false" applyBodyTag="false" renderAs="pdf">
Here is the part of my style that controls borders:
table.gridtable {
border-collapse: collapse;
border: 0px;
}
th {
border: 1px solid #000;
padding: 3px;
border-collapse : collapse;
border-spacing: 0;
}
td {
border: 1px solid #000;
padding: 3px;
border-collapse : collapse;
border-spacing: 0;
}
When I render as html, it looks fine, with all borders as 1px. However, when I render as pdf, some lines are double thickness (and there is no rhyme or reason why some are and some aren't, though the double thickness seem to be around th more than td). I've tried with standardstylesheets="true" and "false" and still get the same results.
<apex:page standardController="Pro_Sale__c" cache="false" standardStylesheets="true" showHeader="false" applyBodyTag="false" renderAs="pdf">
Here is the part of my style that controls borders:
table.gridtable {
border-collapse: collapse;
border: 0px;
}
th {
border: 1px solid #000;
padding: 3px;
border-collapse : collapse;
border-spacing: 0;
}
td {
border: 1px solid #000;
padding: 3px;
border-collapse : collapse;
border-spacing: 0;
}
When I render as html, it looks fine, with all borders as 1px. However, when I render as pdf, some lines are double thickness (and there is no rhyme or reason why some are and some aren't, though the double thickness seem to be around th more than td). I've tried with standardstylesheets="true" and "false" and still get the same results.
th{
border-left: 1px solid #000;
border-right: 1px solid #000;
border-top: 1px solid #000;
.......
.........
}
Thanks,
Kaustav
I found a blog post (http://blog.adityanaag.com/26/Styling+Visualforce+PDFs) which has good info on Apex PDF table design, and it inspired me to add a couple of tags. It looked better but was too thick. For fun I tried a half pixel which actually worked, but it's bad practice. In the end, if you use em instead of pixels, and get a measurement you like, you can make the lines look consistent in the Chrome default browser. .02em may not work for you since em is relative to font size, but here's what worked for me:
BEFORE: Chrome rendering table with 1px border with inline browser:
AFTER: Chrome rendering table with .02em border with inline browser: