Web Design Forum  
 
Go Back   Web Design Forum > Web Software > Programming

Reply
 
LinkBack Thread Tools Display Modes
Old 01-10-2012, 05:23 AM   #1
New Member
 
Join Date: Oct 2008
Posts: 6
Default I can't center my Html table in Emails.

Has anyone ever designed an html newsletter from a simple table
and experienced left alignment and no background color issues when sending it through MSN or Gmail?

Am I missing an important code, or line of css?
Thanks to anyone willing to help me out.

HTML Code:
<html>
<head>
<title>Example</title>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
</head>

<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" align="center">

<table bgcolor="#fefdf9" width="600" id="Table_01" border="0" cellpadding="0" cellspacing="0"  align="center"  >
<tr>
<td>
<img src="http://advocacynet.org/wordpress-mu/chooson/files/2009/08/black-box2.jpg" alt="" width="600" height="432" border="0"></td>
</tr>


</table>
</body>
</html>
conflictingcake is offline   Reply With Quote


Old 01-10-2012, 09:39 AM   #2
Gold Member
 
conor's Avatar
 
Join Date: Oct 2008
Location: Ireland
Posts: 349
Default

using CSS in emails is always a pain - its supported differently in every email client.

try adding the align centre to the td:

Code:
<td align="center"></td>
__________________
Conor
conor is offline   Reply With Quote
Old 01-10-2012, 08:42 PM   #3
New Member
 
Join Date: Oct 2008
Posts: 6
Default

Thanks for the reply.

I don't understand why the contents of my table aren't 600 wide like the table. In Email applications there's a padding around each cell and it won't center.



HTML Code:
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">


</head>

<body>

<table width="600"  cellpadding="0" cellspacing="0" border="0" bgcolor="#000000" align="center" >
        
        <tr>
             <td bgcolor="#555555" width="600" height="100"> </td>
        </tr>
        <tr >
             <td bgcolor="#555555" width="600" height="100"></td>
        </tr>
        <tr>
             <td bgcolor="#555555" width="600" height="100"></td>
        </tr>
        <tr>
             <td bgcolor="#555555" width="600" height="100"></td>
        </tr>

</table>
</body>
</html>

conflictingcake is offline   Reply With Quote
Old 01-11-2012, 07:01 AM   #4
Diamond Member
 
Phreaddee's Avatar
 
Join Date: Feb 2011
Location: Newcastle, Australia
Posts: 1,137
Default

Gmail is particularly annoying with email templates.
Ive found much to my annoyance and disgust inline styles virtually everywhere is the only way to make it work well in gmail. And even then...
__________________
if (headhurts == "possibly") {
alert ("keep going!");
}
else if (headhurts == "yes") {
alert ("go to sleep");
}
else if (headhurts == "damn !@#$ mofo scripts...") {
alert ("give up and have a beer!");
}
else {
alert ("watch TV");
}
Phreaddee is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 11:21 AM.


Camera Forum - Computer Forum - Web Design Forum

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.
Content Relevant URLs by vBSEO 3.6.0 ©2011, Crawlability, Inc.