Centering image in <p:layoutUnit> using <p:graphicImage>

UI Components for JSF
Post Reply
facundo
Posts: 7
Joined: 10 Nov 2010, 20:34

11 Nov 2010, 15:17

Great Optimus,

I´ve started using primefaces a few days ago, I´m having problems trying to make de image of <p:graphImage> to be shown centered.
This is the code.

Code: Select all

          <p:layoutUnit id="top" position="top"  height="180" minHeight="100"  >
                    <p:graphicImage url="./images/placa6website3.gif"/>
                </p:layoutUnit>
I haven´t found any documentation that explains any tag related to this matter.

I´m using JSF 1.2 + primfaces 1.1

Any suggestions?
Last edited by facundo on 11 Nov 2010, 15:54, edited 1 time in total.

User avatar
bumble.bee
Posts: 723
Joined: 29 Sep 2010, 21:39
Location: United States

11 Nov 2010, 15:55

PrimeFaces 1.1 is not actively developed anymore so you should consider moving up to PrimeFaces 2 (with JSF 2 and Facelets).

You should be able to center the image using CSS. Maybe wrap the image in a div and set the text-align property of the div to center.

facundo
Posts: 7
Joined: 10 Nov 2010, 20:34

11 Nov 2010, 16:35

Thanks Bumble.bee;

I added the
style =" text-align : center;"
to the <p:layoutUnit> and solved it. The Java environment where the app would be hosted does not suport JSF 2 thats why I use these versions. As soon I develope a new app with better hosting I will use the updated ones.


Thanks!

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 37 guests