function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Sabrina Ghebraoui 4Sabrina Ghebraoui 4 

border-radius table visualforce page

I am trying to put some styling to my table with a border-radius in my visualforce page but when rendered to pdf I dont see the rounded corners.
 
<apex:page standardController="Quote" renderAs="advanced_pdf" cache="false" applyHtmlTag="false" applyBodyTag="false" standardStylesheets="false" showHeader="false" sidebar="false">
    <html>
        <head>
            <style>
                .rcorners1 {
                border-radius: 50px;
                border: 2px solid #000;
                padding: 20px; 
                width: 200px;
                height: 150px;    
                }
                @media print {
                border-radius: 50px;
                border: 2px solid #000;
                padding: 20px; 
                width: 200px;
                height: 150px;   
                }
            </style>
        </head>
        <body>
            <table style="border: 1px solid black; border-radius:50px">
                <tr>
                    <td>
                        test
                    </td>
                </tr>
            </table>
            <p class="rcorners1">Lets look if this works</p>
        </body>
    </html>    
</apex:page>

 
ANUTEJANUTEJ (Salesforce Developers) 
Hi Sabrina,

Can you try mentioning the  styling as a part of the static resource and add it in the visualforce page later as mentioned in  below link

>> https://developer.salesforce.com/forums/?id=906F0000000AsgDIAS

<apex:styleSheet value="{!URLFOR($Resource.Envelope)}" />

I hope this helps and in case if this comes handy can you please choose this as best answer so that it can be useful for others in the future.

Regards,
Anutej
Sabrina Ghebraoui 4Sabrina Ghebraoui 4
Hi ANUTEJ,
it works only when I delete the:
renderAs="pdf"

Regards,
ANUTEJANUTEJ (Salesforce Developers) 
I checked further and found in one of the thread that although it worked for the person in the link mentioned above few were not able to use it so they tried using inline CSS  and they mentioned it would be the best way for rendering the visualforce page in pdf with css can you try this once with simple css and if it works then you can use inline CSS to do styling as per the requirement.

The link to the thread is https://www.forcetalks.com/salesforce-topic/how-to-include-stylesheet-in-visualforce-page-rendered-as-pdf/
Kallu KaliaKallu Kalia
Thank you for the solution