Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8768367
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T17:02:58+00:00 2026-06-13T17:02:58+00:00

I am having a layout problem in one of my primefaces UI. I basically

  • 0

I am having a layout problem in one of my primefaces UI.
I basically have a table wrapped in a DIV with the code below. The last column should contain buttons that I wanted to arrange horizontally
so I enclosed them in a panelGroup

<div style="overflow: auto; height: 300px;">
    <p:dataTable >
        <p:column headerText="Column 1">
        </p:column>
        .
        .
        <p:column headerText="Actions">
            <h:panelGroup layout="span">
                <p:commandButton value="Edit" icon="ui-icon-scissors" />
                <p:commandButton value="Delete" icon="ui-icon-trash" />
            </h:panelGroup>
        </p:column>
    </p:dataTable>
</div>

However, when they are rendered the buttons are arrange vertically. Viewing the HTML code I notice that the buttons are both wrapped in a div
so thats why there is a newline between them.

How to fix this problem?

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T17:02:59+00:00Added an answer on June 13, 2026 at 5:02 pm

    Wrap them with a <h:panelGrid/> or a <p:panelGroup/>. This will render a table with two table cells in the same table row (so they must be appear in the same row):

    With h:panelGrid:

    <h:panelGrid columns="2">
        <p:commandButton value="Edit" icon="ui-icon-scissors" />
        <p:commandButton value="Delete" icon="ui-icon-trash" />
    </h:panelGrid>
    

    With h:panelGroup:

    If you use h:panelGroup without style, styleClass or id attributes the layout attribute has no effect and no additional html will be rendered around your buttons. Anyway, adding the style:

    <h:panelGroup style="white-space: nowrap">
        ....
    </h:panelGroup>
    

    makes them horizontally aligned, no matter which layout value you are using.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am having problem in populating data from a table in one screen to
The problem i am having is I have a simple floated layout with the
I am having issues with layout for Xoom Tablet. Basically, I want one fragment
I'm having a problem with OOM errors in my activities. I have a layout
I am coding this layout as a wordpress theme and having a slight problem
Typical search layout having RelativeLayout, TextView, EditText and Button I have a.9.png image having
we have a Tiles layout page having Header, Menu, Body and Footer. In this
I have one activity in which I am having one TabHost with two tabs.
I'm having this problem with page layout that I've been battling for too long
I have a layout issue where the internal div data seems to be popping

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.