You need to sign in to do that
Don't have an account?
Dogen Zenji
pageBlockTable or dataTable not formatting
Hello all! I really appreciate everyone's input on these boards so I just wanted to start by saying thanks. Perhaps I am missing something but I cannot get a pageBlockTable or dataTable to take any of the formatting attributes like width, columns or columnsWidth. For example...
Regardless of whether I use percentages or pixels for the widths, how many columns are specified or whether I sprecify formatting attributes on the columns themselves, all columns are displayed in a single row making the table too wide and causing a horizontal scroll bar to appear as below...
Even more odd, the HTML seems to be generated correctly for when the rendered code is inspected, the colgroup is there for number of columns and the width attributes are there, they just have no effect in both Firefox 3 and IE7.
Code:
<apex:pageBlockTable value="{!eventOLIs}" var="eventOLI" width="100%">
<apex:column width="15%" headerValue="Brand" value="{!eventOLI.productName}"/>
<apex:column width="15%" headerValue="Product Code" value="{!eventOLI.productCode}"/>
<apex:column width="30%" headerValue="Date"><apex:inputField value="{!eventOLI.oli.ServiceDate}"/></apex:column>
<apex:column width="10%" headerValue="Sales Price"><apex:inputField value="{!eventOLI.oli.UnitPrice}"/></apex:column>
<apex:column width="10%" headerValue="Total Sq Footage"><apex:inputField value="{!eventOLI.oli.Total_Square_Footage__c}"/></apex:column>
<apex:column width="10%" headerValue="Booth #"><apex:inputField value="{!eventOLI.oli.Booth__c}"/></apex:column>
<apex:column width="10%" headerValue="# of Attendees"><apex:inputField value="{!eventOLI.oli.of_Attendees__c}"/></apex:column>
</apex:pageBlockTable>
Regardless of whether I use percentages or pixels for the widths, how many columns are specified or whether I sprecify formatting attributes on the columns themselves, all columns are displayed in a single row making the table too wide and causing a horizontal scroll bar to appear as below...
Even more odd, the HTML seems to be generated correctly for when the rendered code is inspected, the colgroup is there for number of columns and the width attributes are there, they just have no effect in both Firefox 3 and IE7.
Lets say you had a table that is 100 pixels wide with 5 columns. You set the the first column 40% and the remainder to 15%. 15% would be a width of 15 pixels but if your input fields in these columns have a width of 25pixels it is going to cause formatting issues.
I think you can shrink the inputFields by adding the style attribute style="width:15px"
Message Edited by TehNrd on 06-20-2008 11:30 AM
Message Edited by Dogen Zenji on 06-20-2008 11:59 AM
Message Edited by Dogen Zenji on 06-20-2008 12:00 PM