【发布时间】:2014-10-30 20:47:13
【问题描述】:
我创建了一个表格来组织页面上的项目。该页面是属性的编辑页面。 我使用 colspan 扩展行并在行内放置一个文本框并将文本框 wdith 设置为 100%,但是,文本框宽度仍然只占用 1 列的空间而不是 3 列的空间,就像我预期的那样,这里是代码
<table align="left" style="width: 100%; float: left" class="FormFormatTable">
<tr>
<td style="width: 10%; height: 60px">Alert Name</td>
<td colspan="3" style=" ">
<asp:TextBox CssClass="inputBoxes" ID="txtBox_alertName" runat="server"></asp:TextBox>
</td>
</tr>
<tr>
<td style="width: 10%; height: 60px;">Alert</td>
<td style="height: 60px; ">
<asp:DropDownList ID="ddl_AlertTime" runat="server">
<asp:ListItem Value="1">After</asp:ListItem>
<asp:ListItem Value="0">Immediately</asp:ListItem>
</asp:DropDownList>
</td>
<td style="height: 60px; ">
<input id="demo_vertical0" type="number"/></td>
<td style="height: 60px">
<asp:DropDownList ID="DropDownList1" runat="server">
<asp:ListItem>Seconds</asp:ListItem>
<asp:ListItem>Minutes</asp:ListItem>
<asp:ListItem>Hours</asp:ListItem>
</asp:DropDownList>
</td>
</tr>
<tr>
<td style="width: 10%">Severity</td>
<td style=" height: 60px"" >
<asp:DropDownList ID="ddl_Severity" runat="server">
<asp:ListItem Value="1">After</asp:ListItem>
<asp:ListItem Value="0">Immediately</asp:ListItem>
</asp:DropDownList>
</td>
<td style=""> </td>
<td> </td>
</tr>
<tr style="height:60px">
<td style="width: 10%">Receipients</td>
<td colspan="3" style="">
<asp:TextBox CssClass="inputBoxes" ID="txtBox_Receipients" runat="server"></asp:TextBox>
</td>
</tr>
<tr style="height:60px">
<td style="width: 10%">Subject Title</td>
<td colspan="3" style="">
<asp:TextBox CssClass="inputBoxes" ID="txtBox_SubjectTitle" runat="server"></asp:TextBox>
</td>
</tr>
<tr style="height:60px">
<td style="width: 10%">Alert Messsage</td>
<td colspan="3" style="">
<asp:TextBox CssClass="inputBoxes" ID="txtBox_AlertMessage" runat="server"></asp:TextBox>
</td>
</tr>
<tr style="height:60px">
<td style="width: 10%; ">Notification Window</td>
<td style=" ">
<asp:TextBox CssClass="inputBoxes" ID="txtBox_NotificationWindow" runat="server"></asp:TextBox>
</td>
<td style=" "></td>
<td style="height: 60px"></td>
</tr>
<tr style="height:60px">
<td style="width: 10%; ">Notification Frequency</td>
<td style=" ">
<input id="demo_vertical" type="number"/>
</td>
<td style=" "></td>
<td style="height: 60px"></td>
</tr>
<tr style="height:60px">
<td style="width: 10%">Fields to Display in Details</td>
<td colspan="3" style="">
<asp:TextBox CssClass="inputBoxes" ID="txtBox_SubjectTitle3" runat="server"></asp:TextBox>
</td>
</tr>
</table>
css就是这么简单
.inputBoxes {
width: 100%;
}
这是为什么?
我在电脑上的页面截图
【问题讨论】:
-
请您创建一个 JS 小提琴来演示问题和/或生成的 html。
-
你的第一个声明
I created a table to organize my items on a page.已经不推荐了...stackoverflow.com/questions/83073/… -
奇怪,当我粘贴到生成的直接 html 时,它在 JS 中起作用,但是当我编译和运行时它不起作用我在这里发布了网站 testingnan.azurewebsites.net/editcontent 但是如果我在js小提琴使用网页上查看源代码中的代码并在此链接中添加css IT WORKS WHYYY???????????? JS小提琴链接jsfiddle.net/tw02j22t
-
CSS 类
FormFormatTable是否包含任何操作行和列的内容? -
不,我已经删除了那个 css,但是为什么它的呈现与 JS fiddle 和实际页面不同?
标签: c# html css asp.net html-table