【发布时间】:2014-12-16 02:40:57
【问题描述】:
我使用 Struts2 复选框显示带有标题的复选框以及值,如下所示:
<table id="incentiveTable">
<thead>
<tr>
<th colspan="1" style="font-size: 12px; text-align: center; padding: 7px;">
Marketing Incentive
</th>
<th colspan="1" style="font-size: 12px; text-align: center; padding: 7px;">
Advertizing Incentive
</th>
<th colspan="1" style="font-size: 12px; text-align: center; padding: 7px;">
ChannelPlacement Incentive
</th>
</tr>
</thead>
<tbody>
<s:iterator status="stat" value="incentiveList">
<s:checkbox name="checkboxes[%{#stat.marketingIncentive}]" theme="simple" />
<s:checkbox name="checkboxes[%{#stat.advertizingIncentive}]" theme="simple" />
<s:checkbox name="checkboxes[%{#stat.channelPlacementIncentive}]" theme="simple" />
</s:iterator>
</tbody>
</table>
但是,复选框没有正确对齐:
我需要标题是 Marketing Incentive , Advertizing Incentive 和 ChannelPlacement Incentive 与复选框相邻
上面的代码我用过,但是不行
我已经将代码进一步修改为
<table id="incentiveTable">
<thead>
</thead>
<tbody>
<tr>
<td>
Marketing Incentive
</td>
<td>
Advertizing Incentive
</td>
<td>
Advertizing Incentive
</td>
</tr>
<s:iterator status="stat" value="incentiveList">
<tr>
<td>
<s:checkbox name="checkboxes[%{#incentiveList.marketingIncentive}]" theme="simple" />
</td>
<td>
<s:checkbox name="checkboxes[%{#incentiveList.advertizingIncentive}]" theme="simple" />
</td>
<td>
<s:checkbox name="checkboxes[%{#incentiveList.channelPlacementIncentive}]" theme="simple" />
</td>
</tr>
</s:iterator>
<s:submit id="submitButton" name="submit" value="Submit Incentives" onclick='return closeWindow()' disabled="true"/>
</tbody>
</table>
o/p 如第二张图所示
请建议对齐方式
【问题讨论】:
标签: html css jsp checkbox struts2