简体   繁体   中英

Table formatting issue Chrome vs IE/FireFox

Can anyone tell me why this table looks perfect in Chrome but not in IE or FireFox?

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head></head>
<body>
<table cellpadding="0" cellspacing="0">
    <tbody>
        <tr>
            <td colspan="2" rowspan="2" style="padding-left:6px;"><img src="http://www.purelycustom.com/name_decals/style2/borders/tl_black_blue.png" /></td>
            <td colspan="4" style="height:15px; background-color:#00F"></td>
            <td rowspan="4"><img src="http://www.purelycustom.com/name_decals/style2/borders/right_black_blue.png" /></td>
        </tr>
        <tr>
            <td colspan="4" height="13px" style="background-color:#000"></td>
        </tr>
        <tr>
            <td rowspan="2"><img src="http://www.purelycustom.com/name_decals/style2/borders/l_black.png" /></td>
            <td colspan="2" style="background-color:#000000"><img src="http://www.purelycustom.com/name_decals/style2/flags/flag.png" /></td>
            <td style="background-color:#000000"><span style="color:#FFFFFF">YOUR</span></td>
            <td style="background-color:#000000" width="15px"></td>
            <td style="background-color:#000000"><span style="color:#FFFFFF">NAME</span></td>
        </tr>
        <tr>
            <td style="background-color:#000000" colspan="5"></td>
        </tr>
    </tbody>
</table>
</body>
</html>

I included the !DOCTYPE declaration because I know that that has an affect on how the table gets displayed.

set the width of the 1st td in your tr 's... if you add align="right" to the td the images will line up.. may override when adding specific widths to tds

something more effective would be a div with a background image instead of messing with table alignment..

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM