You need to sign in to do that
Don't have an account?
BrianWK
Datatable and pageblocktable not taking full width of page
I recently created my first visualforce page where I'm listing through a collection of information. I've tried both Datatable and pageblocktable and I'm having the same issue with both. When the page renders it appears that the table takes less than 50% of the actual page. I've tried changing the width on the table, the width of each column, I've tried columnswidth and various combination including setting the number of columns in the table. Each time I get very minimal changes where the total width of the table never exceeds 50% of the page width. This causes the data strings in my columns to wrap and appear "smushed" when you can clearly see plenty of "Blank" space off to the right. Example of one of my many attempts is below. Any suggestions on how I can make my table actually use the full space available and not end up with really narrow columns? The only time I can seem to "stretch" the column is when I only display 1 or 2 columns and not the complete 4.
Code:
<apex:pageblocktable value="{!Issues}" var="each" width="100%"> <apex:column width="100%" headervalue="Issue" >{!each.Issue__c}</apex:column> <apex:column width="100%" headervalue="Message Type" > {!each.Type__c}</apex:column> <apex:column width="100%" headervalue="Reported Date" ><apex:outputfield value="{!each.Date__c}"/></apex:column> <apex:column width="100%" headervalue="Comments" >{!each.Client_Comments__c}</apex:column> </apex:pageblocktable>
All Answers
If you add the column attribute to your section, and the value is 1, the datatable or pageblocktable will span the whole page.