Is it possible to centre a <table> nested in a <td> using CSS only?

Is it possible to centre a <table> nested in a <td> using CSS alone and no HTML attributes.

It needs to work in all version of Outlook.

I know I can just add the align="center" attribute to the table but I'd really like it to be CSS only. Nothing seems to work. text-align doesn't effect tables, margin: 0 auto; doesn't work in Outlook.

It's not a big hassle to add the html attribute but it's one of the only things I can't do in CSS.

Why? I'm trying to create a SASS version of my framework and would like to be able to deal with all presentation styles in CSS.

Just to be clear:

<td class="button-wrap">
<table class="button"> <!-- Centre this table inside it's parent <td> without using HTML attributes -->
<tr class="">
<td class="">
<a href="" >Button link ></a>
</td>
</tr>
</table>
</td>

Thanks in advance for any comments.

wilbertheinen wilbertheinen, 1 year ago

Could you try without shorthand? like this:

margin-left: auto;
margin-right: auto;


Create a Clang!
juleschz, 1 year ago

Did you try to wrap your table inside a <center> tag like this :
<td class="button-wrap">
<center>
<table class="button"> <!-- Centre this table inside it's parent <td> without using HTML attributes -->
<tr class="">
<td class="">
<a href="" >Button link ></a>
</td>
</tr>
</table>
</center>
</td>

200,000 companies around the world can't be wrong.

From Australia to Zimbabwe, and everywhere in between, companies count on 
Campaign Monitor for email campaigns that drive real business results.

Get started for free
1-888-533-8098