1

I am new to Force.com technologies. I was trying to render a table in pdf but its borders are missing. I googled and looked for other answers, but couldn't resolve the issue. My style is inside

<head></head>

tags. I also tried to apply padding 1px to td as following:

td { padding : 1px; }

Can someone help me to get the borders? I am posting the code snippet below:

<apex:page standardController="Proposal__Proposal__c" 

extensions="DDGController" showHeader="false" action="{!init}" renderAs="PDF">

<apex:includeScript value="{!URLFOR($Resource.JQueryUILibrary19, 'js/jquery-1.8.3.min.js')}" />
<apex:includeScript value="{!URLFOR($Resource.JQueryUILibrary19, 'js/jquery-ui-1.9.2.custom.min.js')}" />


<html>

<head>
    <style>
    /* Font Definitions */
    @font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;
        mso-font-charset:1;
        mso-generic-font-family:roman;
        mso-font-format:other;
        mso-font-pitch:variable;
        mso-font-signature:0 0 0 0 0 0;}
    @font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;
        mso-font-charset:0;
        mso-generic-font-family:swiss;
        mso-font-pitch:variable;
        mso-font-signature:-536870145 1073786111 1 0 415 0;}
    /* Style Definitions */
    p.MsoNormal, li.MsoNormal, div.MsoNormal
        {mso-style-unhide:no;
        mso-style-qformat:yes;
        mso-style-parent:"";
        margin-top:0in;
        margin-right:0in;
        margin-bottom:8.0pt;
        margin-left:0in;
        line-height:107%;
        mso-pagination:widow-orphan;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;
        mso-ascii-font-family:Calibri;
        mso-ascii-theme-font:minor-latin;
        mso-fareast-font-family:Calibri;
        mso-fareast-theme-font:minor-latin;
        mso-hansi-font-family:Calibri;
        mso-hansi-theme-font:minor-latin;
        mso-bidi-font-family:"Times New Roman";
        mso-bidi-theme-font:minor-bidi;}
    span.MsoPlaceholderText
        {mso-style-noshow:yes;
        mso-style-priority:99;
        mso-style-unhide:no;
        color:gray;}
    span.SpellE
        {mso-style-name:"";
        mso-spl-e:yes;}
    .MsoChpDefault
        {mso-style-type:export-only;
        mso-default-props:yes;
        font-family:"Calibri",sans-serif;
        mso-ascii-font-family:Calibri;
        mso-ascii-theme-font:minor-latin;
        mso-fareast-font-family:Calibri;
        mso-fareast-theme-font:minor-latin;
        mso-hansi-font-family:Calibri;
        mso-hansi-theme-font:minor-latin;
        mso-bidi-font-family:"Times New Roman";
        mso-bidi-theme-font:minor-bidi;}
    .MsoPapDefault
        {mso-style-type:export-only;
        margin-bottom:8.0pt;
        line-height:107%;}
    @page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;
        mso-header-margin:.5in;
        mso-footer-margin:.5in;
        mso-paper-source:0;}
    div.WordSection1
        {page:WordSection1;}
            .imagewrapper { display:inline-block; }
            .imagewrapper>img {width:auto !important; max-width:100%; max-height:100%;display:inline-block;}
    td {
      vertical-align: bottom;
      border: 1px solid #000;
      border-spacing: 0;
      border-collapse: collapse;
      text-align:center;
      padding: 1px;
    }
    </style>
</head>

<body lang="EN-US" style='tab-interval:.5in'>

<p class="MsoNormal"><span style='mso-tab-count:1'>               </span>Table:</p>


<table class="MsoTableGrid" border="1" cellspacing="0" cellpadding="0" style='border-collapse:collapse;border:none;mso-border-alt:solid windowtext .5pt;
  mso-yfti-tbllook:1184;mso-padding-alt:0in 5.4pt 0in 5.4pt'> 
  <tr style='mso-yfti-irow:0;mso-yfti-firstrow:yes'>
   <td width="260" valign="top" style='width:155.8pt;border:solid windowtext 1.0pt;
   mso-border-alt:solid windowtext .5pt;padding:0in 5.4pt 0in 5.4pt'>
   <p class="MsoNormal" style='margin-bottom:0in;margin-bottom:.0001pt;
   line-height:normal'>Line Item Id</p>
   </td>
   <td width="260" valign="top" style='width:155.85pt;border:solid windowtext 1.0pt;
   border-left:none;mso-border-left-alt:solid windowtext .5pt;mso-border-alt:
   solid windowtext .5pt;padding:0in 5.4pt 0in 5.4pt'>
   <p class="MsoNormal" style='margin-bottom:0in;margin-bottom:.0001pt;
   line-height:normal'>Quantity</p>
   </td>
   <td width="260" valign="top" style='width:155.85pt;border:solid windowtext 1.0pt;
   border-left:none;mso-border-left-alt:solid windowtext .5pt;mso-border-alt:
   solid windowtext .5pt;padding:0in 5.4pt 0in 5.4pt'>
   <p class="MsoNormal" style='margin-bottom:0in;margin-bottom:.0001pt;
   line-height:normal'>Created </p>
   </td>
   <td width="260" valign="top" style='width:155.85pt;border:solid windowtext 1.0pt;
   border-left:none;mso-border-left-alt:solid windowtext .5pt;mso-border-alt:
   solid windowtext .5pt;padding:0in 5.4pt 0in 5.4pt'>
   <p class="MsoNormal" style='margin-bottom:0in;margin-bottom:.0001pt;
   line-height:normal'>Unit Price</p>
   </td>
  </tr>


 <c:ExampleComponent nameofchildobject="Object__c" conditioncriteria="" var="object">
<tr style='mso-yfti-irow:1;mso-yfti-lastrow:yes'>

   <td width="260" valign="top" style='width:155.8pt;border:solid windowtext 1.0pt;
    border-top:none;mso-border-top-alt:solid windowtext .5pt;mso-border-alt:
    solid windowtext .5pt;padding:0in 5.4pt 0in 5.4pt'>
    <p class="MsoNormal" style='margin-bottom:0in;margin-bottom:.0001pt;
    line-height:normal'><span><apex:outputText > {!object['Name']} </apex:outputText></span></p>

    </td>

   <td width="260" valign="top" style='width:155.85pt;border-top:none;border-left:
    none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
    mso-border-top-alt:solid windowtext .5pt;mso-border-left-alt:solid windowtext .5pt;
    mso-border-alt:solid windowtext .5pt;padding:0in 5.4pt 0in 5.4pt'>
    <p class="MsoNormal" style='margin-bottom:0in;margin-bottom:.0001pt;
    line-height:normal'><span><apex:outputText > {!object['Quantity__c']} </apex:outputText></span></p>
    </td>

   <td width="260" valign="top" style='width:155.85pt;border-top:none;border-left:
    none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
    mso-border-top-alt:solid windowtext .5pt;mso-border-left-alt:solid windowtext .5pt;
    mso-border-alt:solid windowtext .5pt;padding:0in 5.4pt 0in 5.4pt'>
      <p class="MsoNormal"><span><apex:outputText value="{0, date,MMMM dd', 'yyyy}"><apex:param value="{!object['Service_Date__c']}"/></apex:outputText></span></p>
    </td>

   <td width="260" valign="top" style='width:155.85pt;border-top:none;border-left:
    none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
    mso-border-top-alt:solid windowtext .5pt;mso-border-left-alt:solid windowtext .5pt;
    mso-border-alt:solid windowtext .5pt;padding:0in 5.4pt 0in 5.4pt'>
      <p class="MsoNormal"><span><apex:outputText value="{0, number, currency}"><apex:param value="{!object['Unit_Price__c']}"/></apex:outputText></span></p>
    </td>


  </tr>
 </c:ExampleComponent>
</table>
0

Try following css by specifying it as print media:

<style type="text/css" media="print">


          table, td {
              vertical-align: bottom;
              border: solid 1px #000;
              border-spacing: 0;
              border-collapse: collapse;
              text-align:center;
              padding: 1px;
          }



</style>
  • Problem still persists! Thanks for the answer though! – user277360 Nov 13 '15 at 18:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.