Salesforce Stack Exchange is a question and answer site for Salesforce administrators, implementation experts, developers and anybody in-between. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm using a pageBlock component, it's obviously very handy for storing my returned object/s but I really don't like how it looks. As I'm quite new to apex/salesforce, I'm wondering is there a way to overwrite the styles attached to the pageBlock?

Is there a convention for it? Or can I even use a regular html table in it's place?

        <apex:pageBlock >

        <apex:pageBlockSection columns="1">

           <apex:pageBlockTable value="{!attachments}" var="attach" id="attachmentsTable">

               <apex:column >
                   <apex:outputText value="{!}"/>

               <apex:column >
                   <apex:outputText value="{!attach.description}"/>

               <apex:column >
                   <apex:outputLink styleClass="actionLink" target="_BLANK" value="/servlet/servlet.FileDownload?file={!attach.Id}">View</apex:outputLink>



share|improve this question
Keep in mind that salesforce does not guarantee the output html or their css to be the same in new releases. – Samuel De Rycke Apr 16 '14 at 9:37
up vote 6 down vote accepted

Yes, you can overwrite it with your own CSS, just don't forget to insert !important. Or you can assign your own css class to the components using styleClass="myCssClass" parameter.

Of course you can create your own pure HTML table and iterate through attachments list using apex:repeat tag:

    <apex:repeat value="{!attachments}" var="attach">
            <td><apex:outputText value="{!}"/></td>
            <td><apex:outputText value="{!attach.description}"/></td>
share|improve this answer
Ah!! Good lad mast0r!! This is exactly what I need! Cheers!! – Daft Apr 16 '14 at 9:45

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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