In my JSF 2 - Primefaces 3 web application, I am using
Look at the generated HTML output and alter CSS accordingly.
If the HTML element which you'd like to center is a block element (
<table>, etc, or forced by
display: block;), then you first need to give it a known width and then you can center it relative to its parent block element using CSS
margin: 0 auto; on the element itself.
If the HTML element which you'd like to center is an inline element (
<img>, etc, or forced by
display: inline;), then you can center it using CSS
text-align: center; on its parent block element.