Activity Forums Salesforce® Discussions Can we create a collapsible pageblock table or Html table on a visualforce page?

  • Abhinav

    Member
    May 30, 2016 at 2:56 pm

    Hi Ajit,

    Please use the below example/code. This will help you.

    <apex:page >
    <apex:pageBlock id="block1">
    <apex:pageBlockSection id="section1" columns="2" collapsible="true" title="Title">
    Example Area
    </apex:pageBlockSection>
    <font color="#FF0000"><script>
    twistSection(document.getElementById('{!$Component.block1.section1}').getElementsByTagName('img')[0])
    </script></font>
    </apex:pageBlock>
    </apex:page>

  • shariq

    Member
    July 31, 2017 at 6:16 am

    Hi Ajit,

    You can create collapsible pageblock table using pageblock section:-

    <!-- Page: -->
    <apex:page standardController="Account">
    <apex:form>
    <apex:pageBlock title="My Content" mode="edit">
    <apex:pageBlockButtons>
    <apex:commandButton action="{!save}" value="Save"/>
    </apex:pageBlockButtons>
    <apex:pageBlockSection title="My Content Section" columns="2" collapsible="true">
    <apex:inputField value="{!account.name}"/>
    <apex:inputField value="{!account.site}"/>
    <apex:inputField value="{!account.type}"/>
    <apex:inputField value="{!account.accountNumber}"/>
    </apex:pageBlockSection>
    </apex:pageBlock>
    </apex:form>
    </apex:page>
    Hope this helps

  • Guha

    Member
    September 25, 2017 at 3:04 am

    Very simple - Add this below attribute to your VF tags.

    <apex:pageBlockSection collapsible=”true” >

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos