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
Jannu SairamJannu Sairam 

how to do row styling as a cash receipt in pdf by using vf pages

Arun Kumar 1141Arun Kumar 1141

Hi Jannu,

Here is the sample code of VF page and it will work.

<apex:page controller="FormController" renderAs="pdf">
    <style>
        .row-style {
            background-color: #c1c1c1;
            font-size: 10px;
            padding: 3px;
        }
    </style>
    <h2>Cash Sample</h2>
    <p>Customer Name: {!receiptInstance.CustomerName__c}</p>
    <table>
        <tr>
            <th>Amount</th>
        </tr>
        <apex:repeat value="{!receiptItems}" var="item">
            <tr class="row-style">
                <td>{!item.Price__c}</td>
            </tr>
        </apex:repeat>
    </table>
</apex:page>
Please mark it as the best answer if it will help you.
Thanks