我需要一个网络表单上的表格,其中包含一个可编辑的列。
我尝试了一个 HTML 表格,但tbody{height:150px; overflow:auto;}
事实证明,用正文中的列排列列标题很难,在正文中使用<input>
标签更难。此外,<input>
内部的宽度<table>
是不可改变的;size 选项是关于文本框中允许的字符数。
我试过 DevExpress,但很难得到一个可编辑的列。
现在我正在尝试一个 ASP Gridview,但发现很难微调布局。这是我的新 App_Themes 中的 CSS:
table#GridView_Samples
{
table-layout:fixed;
border:1px solid grey;
}
table#GridView_Samples th
{
font-family:Verdana;font-size:11px; font-style:normal;
}
table#GridView_Samples td
{
font-family:Verdana;font-size:11px; font-style:normal;
border:1px solid lightgrey;
padding: 0px, 5px 0px, 5px;
}
字体已正确更改,但列标题仍为粗体,并且填充不起作用。
会不会是失败的 CSS 选项被 Microsoft 默认主题设置否决了?而且,一般来说,不可能微调 ASP 控件的所有方面?
编辑:这是html输出的片段(手工漂亮):
<table cellspacing="0" rules="all" Mode="NumericFirstLast"
border="1" id="GridView_Samples"
style="border-collapse:collapse;">
<tr>
<th scope="col">Project</th>
<th scope="col">Monster</th>
<th scope="col">Omschrijving</th>
<th scope="col">% Lutum (gemeten)</th>
<th scope="col">% Org.Stof (gemeten)</th>
<th scope="col">% Lutum (toetsing)</th>
<th scope="col">% Org.Stof (toetsing)</th>
</tr>
<tr>
<td style="width:60px;">P-0002</td>
<td style="width:60px;">S-01</td>
<td style="width:150px;">Sample 01</td>
<td style="width:60px;">4</td>
<td style="width:70px;">20</td>
<td style="width:60px;">
<input name="GridView_Samples$ctl02$TextBoxLutum" type="text"
id="GridView_Samples_TextBoxLutum_0" style="width:60px;" />
</td>
<td style="width:70px;">
<input name="GridView_Samples$ctl02$TextBoxOrganicMatter" type="text"
id="GridView_Samples_TextBoxOrganicMatter_0" style="width:70px;" />
</td>
</tr>