Home > Back-end >  Html table not displaying table properly why is it pushed to the side
Html table not displaying table properly why is it pushed to the side

Time:09-13

My table is stuck to the side. there is a image attached 1: https://i.stack.imgur.com/ZCVcG.png

 <table border="1" >
                <tr>
                    <th>Occupation</th>
                    <td scope="col">space</td>
                </tr>
</table>

CodePudding user response:

Set maring:0px auto; to your parent class of table. It will push it to center

CodePudding user response:

If you are developing a site you can use margin-left: auto; margin-right: auto; on the table itself. If you are developing an email, the better solution is to add align="center" attribute (do not confuse it with text-align: center CSS declaration) to the table tag. This attribute applied to the table centers the table itself, not its content.

  • Related