【发布时间】:2014-10-14 21:25:41
【问题描述】:
如何使用 css 或 jquery 将其更改为 2 列或 3 列,目前它在一列中
这里是小提琴的链接。 http://jsfiddle.net/4510f0yx/1/
<table class="items table table-striped table-bordered table-condensed">
<thead>
<tr>
<th id="operations_c0" class="checkbox-column">
<input type="checkbox" id="operations_c0_all" name="operations_c0_all" value="1" class="select-on-check-all">
</th>
<th id="operations_c1">Permissions</th>
</tr>
</thead>
<tbody>
<tr class="">
<td colspan="2" class="extrarow"><strong>Auth :: Permission</strong>
</td>
</tr>
<tr class="odd">
<td class="checkbox-column">
<input type="checkbox" name="AuthItem[seltedOperations][]" id="operations_c0_0" value="oAuthOperationCreate" class="select-on-check">
</td>
<td>Create</td>
</tr>
<tr class="even">
<td class="checkbox-column">
<input type="checkbox" name="AuthItem[seltedOperations][]" id="operations_c0_1" value="oAuthOperationRead" class="select-on-check">
</td>
<td>Read</td>
</tr>
<tr class="odd">
<td class="checkbox-column">
<input type="checkbox" name="AuthItem[seltedOperations][]" id="operations_c0_2" value="oAuthOperationUpdate" class="select-on-check">
</td>
<td>Update</td>
</tr>
<tr class="even">
<td class="checkbox-column">
<input type="checkbox" name="AuthItem[seltedOperations][]" id="operations_c0_3" value="oAuthOperationDelete" class="select-on-check">
</td>
<td>Delete</td>
</tr>
<tr class="odd">
<td class="checkbox-column">
<input type="checkbox" name="AuthItem[seltedOperations][]" id="operations_c0_4" value="oAuthOperationList" class="select-on-check">
</td>
<td>List</td>
</tr>
<tr class="even">
<td class="checkbox-column">
<input type="checkbox" name="AuthItem[seltedOperations][]" id="operations_c0_5" value="oAuthOperationManage" class="select-on-check">
</td>
<td>Manage</td>
</tr>
<tr class="odd">
<td class="checkbox-column">
<input type="checkbox" name="AuthItem[seltedOperations][]" id="operations_c0_6" value="oAuthOperationSearch" class="select-on-check">
</td>
<td>Search</td>
</tr>
<tr class="">
<td colspan="2" class="extrarow"><strong>Auth :: Parent</strong>
</td>
</tr>
<tr class="even">
<td class="checkbox-column">
<input type="checkbox" name="AuthItem[seltedOperations][]" id="operations_c0_7" value="oAuthParentCreate" class="select-on-check">
</td>
<td>Create</td>
</tr>
<tr class="odd">
<td class="checkbox-column">
<input type="checkbox" name="AuthItem[seltedOperations][]" id="operations_c0_8" value="oAuthParentRead" class="select-on-check">
</td>
<td>Read</td>
</tr>
<tr class="even">
<td class="checkbox-column">
<input type="checkbox" name="AuthItem[seltedOperations][]" id="operations_c0_9" value="oAuthParentUpdate" class="select-on-check">
</td>
<td>Update</td>
</tr>
<tr class="odd">
<td class="checkbox-column">
<input type="checkbox" name="AuthItem[seltedOperations][]" id="operations_c0_10" value="oAuthParentDelete" class="select-on-check">
</td>
<td>Delete</td>
</tr>
<tr class="even">
<td class="checkbox-column">
<input type="checkbox" name="AuthItem[seltedOperations][]" id="operations_c0_11" value="oAuthParentList" class="select-on-check">
</td>
<td>List</td>
</tr>
<tr class="odd">
<td class="checkbox-column">
<input type="checkbox" name="AuthItem[seltedOperations][]" id="operations_c0_12" value="oAuthParentManage" class="select-on-check">
</td>
<td>Manage</td>
</tr>
<tr class="even">
<td class="checkbox-column">
<input type="checkbox" name="AuthItem[seltedOperations][]" id="operations_c0_13" value="oAuthParentSearch" class="select-on-check">
</td>
<td>Search</td>
</tr>
<tr class="">
<td colspan="2" class="extrarow"><strong>Auth :: Role</strong>
</td>
</tr>
<tr class="odd">
<td class="checkbox-column">
<input type="checkbox" name="AuthItem[seltedOperations][]" id="operations_c0_14" value="oAuthRoleCreate" class="select-on-check">
</td>
<td>Create</td>
</tr>
<tr class="even">
<td class="checkbox-column">
<input type="checkbox" name="AuthItem[seltedOperations][]" id="operations_c0_15" value="oAuthRoleRead" class="select-on-check">
</td>
<td>Read</td>
</tr>
<tr class="odd">
<td class="checkbox-column">
<input type="checkbox" name="AuthItem[seltedOperations][]" id="operations_c0_16" value="oAuthRoleUpdate" class="select-on-check">
</td>
<td>Update</td>
</tr>
<tr class="even">
<td class="checkbox-column">
<input type="checkbox" name="AuthItem[seltedOperations][]" id="operations_c0_17" value="oAuthRoleDelete" class="select-on-check">
</td>
<td>Delete</td>
</tr>
<tr class="odd">
<td class="checkbox-column">
<input type="checkbox" name="AuthItem[seltedOperations][]" id="operations_c0_18" value="oAuthRoleList" class="select-on-check">
</td>
<td>List</td>
</tr>
<tr class="even">
<td class="checkbox-column">
<input type="checkbox" name="AuthItem[seltedOperations][]" id="operations_c0_19" value="oAuthRoleManage" class="select-on-check">
</td>
<td>Manage</td>
</tr>
<tr class="odd">
<td class="checkbox-column">
<input type="checkbox" name="AuthItem[seltedOperations][]" id="operations_c0_20" value="oAuthRoleSearch" class="select-on-check">
</td>
<td>Search</td>
</tr>
</tbody>
</table>
【问题讨论】:
-
所以不能改html?
-
是的,它基于一个框架,如果我们有一个 css 解决方案会更好,如果不是在最坏的情况下也可以
-
您不能使用 css 更改
<tr><td>的对齐方式。你必须改变你的 HTML sn-p -
好的,但我认为使用 jquery 是可能的。
-
是的,肯定可以使用 Jquery。像这样stackoverflow.com/a/6298066/2236219