You submitted this question in Articles and I have moved it to forum for discussion and also if you would like to align to vertical center or horizontal center is not clear but I would try to explain both.

For Horizontal center you can use align:center as a style but for vertical center you have to use Javascript to get the height and then position accordingly or even try valign:middle but that would mean you need