Search code examples
salesforceapex-codevisualforceforce.com

How do I make a pageblock title inside of a panelgrid span the full width of the pageblock?


I have multiple <apex:pageblock>s in an <apex:panelgrid>. The title of the <apex:pageblock>s wraps prematurely, and I can't figure out why. Here's an example of what it looks like.

pageblock_title_wrapping_exapmle

I don't seen any reason why the title shouldn't span the entire width of the <apex:pageblock>. Anyone else? I'm also open to hacks to get around the issue.


Solution

  • Salesforce wraps the title in a <td> and sets its width to 30%. You can override this with some css like

    td.pbTitle {
        width: 60%;
    }