【发布时间】:2013-02-12 00:36:09
【问题描述】:
我有下表。
我想从列标题中删除城市名称并将其放在顶部。如下:
带有城市名称的列是在代码中动态添加的,可以是任意数字,即 0、1 到任意数字。
表结构为:
<table class="gvv1" cellspacing="0" rules="all" border="1" id="MainContent_gvActivities"
style="border-collapse: collapse;">
<tr style="background-color: buttonface;">
<th scope="col">
</th>
<th scope="col">
Cluster
</th>
<th scope="col">
Activity
</th>
<th scope="col">
Data
</th>
<th scope="col">
<b>London_Tasks</b>
</th>
<th scope="col">
<b>London_Achieved</b>
</th>
<th scope="col">
<b>Geneva_Tasks</b>
</th>
<th scope="col">
<b>Geneva_Achieved</b>
</th>
</tr>
<tr>
<td>
<input id="chkSelected_0" type="checkbox" />
</td>
<td style="width: 50px; white-space: nowrap;">
ER.
</td>
<td style="width: 50px; white-space: nowrap;">
Provision
</td>
<td style="width: 60px; white-space: nowrap;">
number
</td>
<td>
<input name="ctl00Activitiesl00" type="text" value="-1.00" />
</td>
<td>
<input name="ctl00Activitiesl01" type="text" value="-1.00" />
</td>
<td>
<input name="ctl00Activitiesl02" type="text" value="-1.00" />
</td>
<td>
<input name="ctl00Activitiesl03" type="text" value="-1.00" />
</td>
</tr>
<tr>
<td>
<input id="chkSelected_1" type="checkbox" />
</td>
<td style="width: 50px; white-space: nowrap;">
ER.
</td>
<td style="width: 50px; white-space: nowrap;">
support
</td>
<td style="width: 60px; white-space: nowrap;">
campaign (Numbers)
</td>
<td>
<input name="ctl0Activities200" type="text" value="-1.00" />
</td>
<td>
<input name="ctl0Activities201" type="text" value="-1.00" />
</td>
<td>
<input name="ctl0Activities202" type="text" value="-1.00" />
</td>
<td>
<input name="ctl0Activities203" type="text" value="-1.00" />
</td>
</tr>
</table>
【问题讨论】:
-
你会尝试一些东西的。请发布该代码。
-
@techfoobar 我可以在 tr:first 中使用 grid 和 before 添加行,但这些列是动态的,可以是 1 或 5 或 10。而且我无法从列标题中删除文本和放在上面。
标签: javascript jquery gridview