A simple dataTable has no CSS when rendered in Chrome. It just renders plain text.

            <apex:dataTable value="{!outstandingCoachingTasks}" var="task" id="taskTable"
                rowClasses="odd,even" styleClass="tableClass">
                <apex:facet name="caption">table caption</apex:facet>
                <apex:facet name="header">table header</apex:facet>
                <apex:facet name="footer">table footer</apex:facet>

                    <apex:facet name="header">Name</apex:facet>
                    <apex:facet name="footer">column footer</apex:facet>
                    <apex:outputText value="{!task.Name}"/>

                    <apex:facet name="header">Owner</apex:facet>
                    <apex:facet name="footer">column footer</apex:facet>
                    <apex:outputText value="{!task.Task_For__c}"/>


An <apex:dataTable> is always unstyled. You might want to use <apex:pageBlockTable> within an <apex:pageBlock>.

See https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_compref_pageBlockTable.htm

Even so, you might get plain unstyled tables if the standard Salesforce stylesheets have been disabled on the page level.

Check for <apex:page standardStylesheets="false"> at the very top of the page.

See https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_compref_page.htm

  • Yeah sorry, I skimmed over the question too quickly. A datatable is always unstyled. See updated answer. – Willem Mulder Feb 23 '17 at 13:36
  • OK. Changed to pageBlockTable and it looks better. I usually us pbt, but I thought dataTable was supposed to give me some more functionality. – SkipVV Feb 23 '17 at 13:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.