Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

DIV center align

I have div, which has all content aligned to center:

<div align="center">
   <table><tr><td>.....

But align is not more valid attribute. So, i have changed to class or style:

<div style="text-align:center;">

But it is not the same as before. Table is now aligned to left and not to center. Obvious text-align is not equivalent to old center attribute. How should i write style to achieve the same functionality as before with center attribute?

like image 696
Simon Avatar asked Mar 19 '23 00:03

Simon


1 Answers

Just use margin: 0 auto on your table to center it.

See HERE

like image 83
mattytommo Avatar answered Mar 25 '23 07:03

mattytommo