开发者

CSS Padding of a nested table ignored by Opera

开发者 https://www.devze.com 2023-01-09 05:49 出处:网络
I am using a table nested in a table which happens to have the border-collapse:collapse; property. The problem is with the 开发者_如何学Gopadding property of the nested table, which Opera seems to ign

I am using a table nested in a table which happens to have the border-collapse:collapse; property. The problem is with the 开发者_如何学Gopadding property of the nested table, which Opera seems to ignore.

To reduce it to the simplest possible, with the following HTML code...:

<table style="border-collapse:collapse;">
    <tr>
        <td>
            <table style="padding:3em;">
                <tr><td>ABCDE</td></tr>
            </table>
        </td>
    </tr>
</table>

...the padding property is ignored by Opera, whereas Firefox, Chrome and Safari take it into account in the rendering.

My question is: which one is right? Should I leave it this way and ignore Opera users, or search another way to set my padding because Opera is right on the syntax?


In your case I would simply put the padding in the containing <TD>. If you want to keep it on the table and ignore Opera users, you are not alienating a huge portion of the Web users, though some will no doubt be irritated.

0

精彩评论

暂无评论...
验证码 换一张
取 消