Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

table formatting without css

Tags:

html

css

I have a table defined as

<table border="1" width="200px" height="auto">
<tr>
<td></td>
</tr>
</table>

Is there a way that I can align the table at the center of the page, apply background color to page without using css for any of these operations?

like image 630
user544079 Avatar asked May 02 '11 20:05

user544079


2 Answers

I assume you are doing something horrible like HTML email:

<center><table bgcolor="#ff00ff"></table></center>
like image 183
Phrogz Avatar answered Oct 14 '22 05:10

Phrogz


<center>
    <table border="1" cellspacing="0" cellpadding="0" width="200" align="center">
        <tr>
            <td background="http://www.yourdomain.com/email/images/background.jpg" align="left">
            <!-- Stuff -->
            </td>
        </tr>
    </table>
</center>
  • http://www.email-standards.org/
  • http://mailchimp.com/resources/guides/email-marketing-field-guide/
  • http://www.1stwebdesigner.com/tutorials/ultimate-guide-html-emails/

The background attribute was never valid on table or td. Pretty sure the only thing the HTML 4 specification had background on was body. But I vaguely recall that it worked elsewhere and I think table cells was elsewhere--whether it works in Outlook you'll just have to test. bgcolor was valid all of those places...and is likely to work.

like image 23
morewry Avatar answered Oct 14 '22 05:10

morewry