I got the solution for this as below: to do spacing (margin) between columns in pageblocktable there is an attribute that is cellspacing in apex:pageBlockTable tag, by which we can achieve margin/spacing between columns.
Thank you for everyone who tried to provide the solution here.
public class TestTableController {
public List<Account> accountList{get{
return new List<Account>([Select Id, Name, Website, BillingStreet, BillingCity From Account Where BillingStreet != null LIMIT 10]);
}
set;}
public TestTableController(){
}
}
Please mark this as Best Answer, if this helps solve your problem.
whatever solution you guys provided not the solution of the issue pls understand the requirement.... i don't want to change width of the columns .. i want to add margin between columns.
I got the solution for this as below: to do spacing (margin) between columns in pageblocktable there is an attribute that is cellspacing in apex:pageBlockTable tag, by which we can achieve margin/spacing between columns.
Thank you for everyone who tried to provide the solution here.
to do spacing (margin) between columns in pageblocktable there is an attribute that is cellspacing in apex:pageBlockTable tag, by which we can achieve margin/spacing between columns.
Thank you for everyone who tried to provide the solution here.
All Answers
Example:
VF:
Apex:
Please mark this as Best Answer, if this helps solve your problem.
OR
whatever solution you guys provided not the solution of the issue
pls understand the requirement.... i don't want to change width of the columns .. i want to add margin between columns.
at row level, you can use <apex:repeat> to display data and use custom CSS styling to shape the table the way you want.
you can make as much style changes as you want.
2) you can switch off StandardStylesheet like this
<apex:page showheader="false" standardStylesheets="false" controller="TestTableController">
Again you'll have to write custom CSS for the table.
Hope this helps.
Please mark this as Best Answer, if this helps solve your problem.
Below code can fullfill your requirements. Hope this will work for you.
vf page :
<apex:page standardController="Opportunity" tabStyle="Opportunity">
<apex:pageBlock >
<apex:pageBlockTable>
<apex:column value="{!opportunity.Name}" label="Name" width="20%"/>
<apex:column value="{!opportunity.CloseDate}" label="CloseDate" width="20%"/>
<apex:column value="{!opportunity.StageName}" label="StageName" width="20%"/>
</apex:pageBlockTable>
</apex:pageBlock>
</apex:page>
Please mark this as best answer if this solves your problem.
Thank you
Ajay Dubedi
to do spacing (margin) between columns in pageblocktable there is an attribute that is cellspacing in apex:pageBlockTable tag, by which we can achieve margin/spacing between columns.
Thank you for everyone who tried to provide the solution here.