I've got html for a table and I'm trying to center it
<table class="something">
<tr>
<td>words</td>
<td>words2</td>
</tr>
</table>
My CSS
table {
position: absolute;
margin-left: auto;
margin-right: auto;
}
When looking at the dev tools it says, left position : -775 and left margin : 775. right position : 775 and right margin : 775
The right side is as I expect but I can't seem to figure out why the left side is acting the way it does. If I modify the margin and position in the dev tools so its all 775 then it does what I'm expecting. Should I be using some other method for centering this?
In my HTML I do have a 2 other div elements that are above this table and one below.