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
Gaurav_Mishra44553Gaurav_Mishra44553 

why alignment is not working for "Account Name " field using html table in vf page

<apex:page controller="BasicForm">
 <style type="text/css">
       td{
       padding:0px 15px 15px 15px;
}
    </style>

<apex:form >
<table>



<tr>

<td><apex:outputLabel value="AccountNumber" for="theCheckbox2" style="font-weight:bold"/><apex:inputfield value="{!act.Name}" id="theCheckbox2"  /></td>
<td><apex:outputLabel value="Phone" for="theCheckbox3"/><apex:inputfield value="{!act.phone}" id="theCheckbox3" /></td>
<td><apex:outputLabel value="Phone" for="theCheckbox1"/><apex:inputfield value="{!act.phone}" id="theCheckbox1" /></td>
<td><apex:outputLabel value="AccountNumber" for="theCheckbox4" style="font-weight:bold"/><apex:inputfield value="{!act.AccountNumber}" id="theCheckbox4"  /></td>
</tr>


</table>
</apex:form>


</apex:page>

 
Sanjay_GeorgeSanjay_George
When you give alignment like this, upon page width overflow, things will act weird.

If the purpose of Table is alignment, would suggest using <apex:panelgrid> 

Link: https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_compref_panelGrid.htm
brahmaji tammanabrahmaji tammana

Try using pageblock section.

Thanks

Brahma

Nishad KNishad K
Hi MISHRA,
Try this one:
<apex:page controller="BasicForm">
 <style type="text/css">

       .tableStyle td{
       padding:0px 15px 15px 15px !important ;

}
    </style>

<apex:form >
<table class="tableStyle">



<tr>

<td><apex:outputLabel value="AccountNumber" for="theCheckbox2" style="font-weight:bold"/><apex:inputfield value="{!act.Name}" id="theCheckbox2"  /></td>
<td><apex:outputLabel value="Phone" for="theCheckbox3"/><apex:inputfield value="{!act.phone}" id="theCheckbox3" /></td>
<td><apex:outputLabel value="Phone" for="theCheckbox1"/><apex:inputfield value="{!act.phone}" id="theCheckbox1" /></td>
<td><apex:outputLabel value="AccountNumber" for="theCheckbox4" style="font-weight:bold"/><apex:inputfield value="{!act.AccountNumber}" id="theCheckbox4"  /></td>
</tr>


</table>
</apex:form>
Regards,
 
Nishad KNishad K
if it's resolved, mark the answer  and keep the community clean!!