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
Ignacio de la Torre 3Ignacio de la Torre 3 

How to beautify a new dinamic record line in Visualforce page ?? CSS problem

Hi all !

I need to beautify this VF page so that the 'Nombre de Pago' output field is above the 'Importe' field but in the same line, not like now see? I need the fields to be nicely aligned and I'm not being able to do so. I've added some <br></br> tags but still ugly:

User-added image

When the user clicks the Add Row button a new record row is added but not aligned with the rest of the lines.

Any idea how to fix it ?

Here's the VF page code:
 
<apex:page standardController="Cuadre__c" extensions="insertParentChildCon" lightningStylesheets="true" showHeader="false" sidebar="false">
    
    <apex:form >
        <apex:pageBlock >
            <apex:pageBlockButtons >
                <apex:commandButton action="{!QuikSave}" value="Quik Save"/>
                <apex:commandButton action="{!Save}" value="Save"/>
                <apex:commandButton action="{!Cancel}" value="Cancel"/>                
            </apex:pageBlockButtons>
            <apex:pageBlockSection title="Cuadre">
                <apex:outputField value="{!Cuadre__c.Name}"/>
                <apex:outputField value="{!Cuadre__c.PendienteCobro__c}"/>
            </apex:pageBlockSection>
            <apex:pageBlockSection title="Agregar pagos al cuadre">                   
                <apex:repeat value="{!pagoList}" var="pg" id="table">
                    <br></br>
                    <br></br>                    
                    <apex:inputField value="{!pg.Name}"/>                    
                    <apex:inputField value="{!pg.Tipo__c}"/>
                    <apex:inputField value="{!pg.Importe__c}"/>
                    <apex:inputField value="{!pg.FormaPago__c}"/>
                    <br></br>
                    <br></br>
                    <br></br>
                </apex:repeat>                
            </apex:pageBlockSection>
            <apex:commandButton value="Add Row" Action="{!AddRow}" immediate="true" id="button"/> 
            
        </apex:pageBlock>
    </apex:form>

</apex:page>

 
ShirishaShirisha (Salesforce Developers) 
Hi Ignacio,

Greetings!
You can use align functionality align your fields in a column as suggested in the below link:

https://salesforce.stackexchange.com/questions/215821/align-fields-in-column-in-vf-page

Kindly mark it as best answer if it helps so that it can help others in the future.

Warm Regards,
Shirisha Pathuri
SwethaSwetha (Salesforce Developers) 
Hi Ignacio,
You might want to try using <tr> <td> in your <apex:repeat> as written in https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_compref_repeat.htm for better formatting. Thanks