IE(html表)问题

时间:2009-07-23 19:39:08

标签: html internet-explorer html-table

怎么了?

<table id="PollDetails" runat="server" Visible="false">
    <tbody>
        <tr>
            <td align="right">
                Poll Question:
            </td>
            <td align="left">
                <asp:TextBox ID="txtQuestion" runat="server" Width="300"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td align="right" runat="server" id="lblSelection1" visible="true">
                Selection    1:
            </td>
            <td align="left">
                <asp:TextBox ID="txtSelection1" runat="server" Width="300" Visible="false"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td align="right" runat="server" id="lblSelection2" visible="true">
                Selection 2:
            </td>
            <td align="left">
                <asp:TextBox ID="txtSelection2" runat="server" Width="300" Visible="false"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td align="right" runat="server" id="lblSelection3" visible="true">
                Selection 3:
            </td>
            <td align="left">
                <asp:TextBox ID="txtSelection3" runat="server" Width="300" Visible="false"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td align="right" runat="server" id="lblSelection4" visible="true">
                Selection 4:
            </td>
            <td align="left">
                <asp:TextBox ID="txtSelection4" runat="server" Width="300" Visible="false"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td align="right" runat="server" id="lblSelection5" visible="true">
                Selection 5:
            </td>
            <td align="left">
                <asp:TextBox ID="txtSelection5" runat="server" Width="300" Visible="false"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td>
            </td>
            <td>
                <asp:Button ID="btnSave" runat="server" Text="Save Changes" CausesValidation="False" />
                <asp:Button ID="btnCancel" runat="server" Text="Cancel" CausesValidation="False" />
            </td>
        </tr>
    </tbody>
</table>

生成的代码粘贴:

<div>
<table id="ctl00_ContentPage_PollManagement_PollDetails">
<tr>
        <td align="right">
                Poll Question:
           </td>
        <td align="left">
               <input name="ctl00$ContentPage$PollManagement$txtQuestion" type="text"     value="How much time do you spend on a computer daily?" id="ctl00_ContentPage_PollManagement_txtQuestion" style="width:300px;" />
        </td>
</tr>
<tr>
    <td id="ctl00_ContentPage_PollManagement_lblSelection1" align="right">Selection 1:
        </td>
    <td align="left">
            <input name="ctl00$ContentPage$PollManagement$txtSelection1" type="text" value="Less than 1 Hour" id="ctl00_ContentPage_PollManagement_txtSelection1" style="width:300px;" />
        </td>
</tr>
<tr>
    <td id="ctl00_ContentPage_PollManagement_lblSelection2" align="right">Selection 2:

        </td>
    <td align="left">
            <input name="ctl00$ContentPage$PollManagement$txtSelection2" type="text" value="Between 1 and 2 Hours " id="ctl00_ContentPage_PollManagement_txtSelection2" style="width:300px;" />
        </td>
</tr>
<tr>
    <td id="ctl00_ContentPage_PollManagement_lblSelection3" align="right">Selection 3:

        </td>
    <td align="left">
            <input name="ctl00$ContentPage$PollManagement$txtSelection3" type="text" value="Between 2 and 4 Hours " id="ctl00_ContentPage_PollManagement_txtSelection3" style="width:300px;" />
        </td>
</tr>
<tr>
    <td id="ctl00_ContentPage_PollManagement_lblSelection4" align="right">Selection 4:

        </td>
    <td align="left">
            <input name="ctl00$ContentPage$PollManagement$txtSelection4" type="text" value="Between 4 and 8 Hours " id="ctl00_ContentPage_PollManagement_txtSelection4" style="width:300px;" />
        </td>
</tr>
<tr>
    <td id="ctl00_ContentPage_PollManagement_lblSelection5" align="right">Selection 5:

        </td>
    <td align="left">
            <input name="ctl00$ContentPage$PollManagement$txtSelection5" type="text" value="Between 8 and 16 Hours" id="ctl00_ContentPage_PollManagement_txtSelection5" style="width:300px;" />
        </td>
</tr>
<tr>
    <td>
        </td>
    <td>
            <input type="submit" name="ctl00$ContentPage$PollManagement$btnSave" value="Save Changes" id="ctl00_ContentPage_PollManagement_btnSave" />
            <input type="submit" name="ctl00$ContentPage$PollManagement$btnCancel" value="Cancel" id="ctl00_ContentPage_PollManagement_btnCancel" />
        </td>
</tr>

5 个答案:

答案 0 :(得分:3)

发布的表格在IE7上正确显示,因此必须是因为页面中包含HTML标记。

答案 1 :(得分:1)

您使用的是什么DOCTYPE? IE可能会以不同于Firefox的方式解释页面,具体取决于您的DOCTYPE。

如果您不熟悉DOCTYPES,A List Apart对其有很好的描述。

答案 2 :(得分:0)

删除所有[visible =“false”]并填写结束表格表标签可提供所需的输出。从那里开始。

答案 3 :(得分:0)

什么是可见的,什么不是? 将所有的visible = false更改为true,它看起来很好,即7。

答案 4 :(得分:-1)

尝试放一个&amp; NBSP;在靠近底部的空白TD标签内。