Since you mentioned you re using jquery, i assume you would like to do this via javascript. You can add styles to elements in the DOM using Jquery. You can use
http://docs.jquery.com/CSS/css#properties
$(.center).css({ display : block , text-align : center });
Depending on the element, you may be able to center it without having to use text-align:center if you set the margin to
margin: 0 auto 0 auto
This will set the margin on the top and bottom to zero, and auto on the left and right, this can be used to center the block element inside of another block element.
To center an element vertically in jquery you can use this
http://cool-javascripts.com/jquery/vertical-alignment-of-contents-inside-an-element-using-jquery.html
function ($) {
$.fn.vAlign = function(container) {
return this.each(function(i){
if(container == null) {
container = div ;
}
var paddingPx = 10; //change this value as you need (It is the extra height for the parent element)
$(this).html("<" + container + ">" + $(this).html() + "</" + container + ">");
var el = $(this).children(container + ":first");
var elh = $(el).height(); //new element height
var ph = $(this).height(); //parent height
if(elh > ph) { //if new element height is larger apply this to parent
$(this).height(elh + paddingPx);
ph = elh + paddingPx;
}
var nh = (ph - elh) / 2; //new margin to apply
$(el).css( margin-top , nh);
});
};
})(jQuery);