0

I have a pageblock table

<apex:pageBlock id="PubListPanel" >
        <apex:pageblocktable value="{!AModel.List}" var="list">
        <apex:column width="28" rendered=......... >
<\apex:pageBlock>

<apex:pageBlockButtons rendered=.... id="pgbuttonsTop" location="top">
<apex:outputPanel id="pgbuttonsPanelTop">

My problem is that the page block buttons are displayed above the pagebloack table however it is keeping a considerable gap on the left hand side. Please tell me if there is something wrong with my code. Is there any way I can align the pageblockbuttons to the left hand side?enter image description here

2
  • Can you please provide a screenshot and a bigger code sample? Jun 2, 2016 at 12:04
  • can you post a good screenshot on where the gap is and what are you trying to achieve?
    – Anurag
    Jun 2, 2016 at 13:30

1 Answer 1

2

The apex:pageBlockButtons is used to create that button section on the top and/or on the bottom of the pageBlock. If you don't want that behavior, simply add the buttons to you page without using the apex:pageBlockButtons tag

<apex:pageBlock id="PubListPanel" >
        <apex:pageblocktable value="{!AModel.List}" var="list">
        <apex:column width="28" rendered=......... >
<\apex:pageBlock>

<apex:outputPanel id="pgbuttonsPanelTop"><apex:commandbutton .... /></apex:outputPanel>

Also, see documentation for more info.

2
  • you are correct, it is because of the pageblock button and if I remove it, then the buttons are being aligned to the left. I just want to know, why is the pageblockbutton keeping a lot of space on the left hand side and if it would be possible to remove it. I want to keep the apex:pageBlockButtons tag @Fernando
    – Rimii
    Jun 2, 2016 at 12:30
  • 1
    @Rimii, the apex:pageBlockButtons has that large left margin because it is meant to accommodate the title of the apex:pageBlock. If you really want to make it display without that margin, you'll either have to give up the apex:pageBlockButtons tag or get creative with CSS Jun 2, 2016 at 13:53

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.