I'm creating a website that displays some content in a table and I want it to always be centered. Its centered if there is 3 TD's it is centered, but I want it too center a TR in the middle of the 3 TD's when it only has 2 TD's.
I want the Test5 and Test6 to center in the middle of the other TR but I can't seem to figure out how.
My Current code:
<html>
<style>
#Center {
text-align: center;
}
#CenterTable {
text-align: center;
margin-left: auto;
margin-right: auto;
width: 50%;
}
</style>
<div id="Center">
<p>Testing Centered Table</p>
<table id="CenterTable">
<tr>
<td>
Test1
</td>
<td>
Test2
</td>
<td>
Test3
</td>
</tr>
<tr>
<td>
Test4
</td>
<td>
Test5
</td>
</tr>
</table>
</div>
</html>