Forum Moderators: not2easy
I am trying to get a layout working in IE, everything has worked fine. Now the problem I have is just one thing, TD styling. This is my TD code:
td {
font-size: 1.2em;
padding-bottom: 1.2em;
vertical-align: top;
padding: 3px;
color:ccc;
}
and my HTML code is simply for example
<table>
<tr>
<td>Default Text showing here</td>
</tr>
</table>
Now that works fine in Firefox but doesn't show up in internet explorer. For example the colour isn't #ccccc its the default font for IE.
I notice that if I remove:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
From the top of the html code it the TD styling does work in IE, but of course this also makes all my content move to the left in IE due to its inability to recognize the "margin 0, auto;" while in quirks mode.
Any ideas as to why this isn't working for me?
table {
margin: 0;
padding: 0;
}
And add to the table tag:
<table cellpadding="0" cellspacing="0">
If you have multiple tables, you may have to assign a class or id to the CSS
example:
table.nopadding /* or #nopadding */ {
margin: 0;
padding: 0;
}
<table cellpadding="0" cellspacing="0" class="nopadding">
or
<table cellpadding="0" cellspacing="0" id="nopadding">
Marshall
[edited by: Marshall at 4:35 am (utc) on Sep. 30, 2007]
td {
font-size: 1.2em;
padding-bottom: 1.2em;
vertical-align: top;
padding: 3px;
color:ccc;
}
Also, the colour problem -might- be because it should be
color: #ccc; rather than color: ccc; (you need the hash symbol.) Though I was fairly sure the lack of the hash symbol would make it not work in Firefox, rather than not work in IE.
Are you sure you don’t have any other conflicting CSS, that is rendering over the top of it?