我有這個功能單列轉換爲多列
function renderListSelecoes(data) {
// JAX-RS serializes an empty list as null, and a 'collection of one' as an object (not an 'array of one')
var list = data == null ? [] : (data.selecoes instanceof Array ? data.selecoes : [data.selecoes]);
$('#selecaoList <tr><td>').remove();
$.each(list, function(index, selecao) {
$('#selecaoList').append('<tr><td><a href="#" data-identity="' + selecao.id_selecao + '">'+selecao.nome+'</a></td></tr>');
});
}
that's插入每一行表中的東西,像這樣:
Brasil
Argentina
Colômbia
Uruguai
Suíça
Argélia
Costa do Marfim
Gana
我怎樣才能將它轉換爲例如2columns,像這樣:
Brasil Costa do Marfim
Argentina Gana
Colômbia Argélia
Uruguai Suiça
這裏是HTML我的代碼部分:
<div class="table-responsive container" >
<table class="table">
<tbody id="selecaoList">
</tbody>
</table>
</div>
是數據在陣列?到第2列和第1列是否有關係? – PeterKA
它可以是別的東西比表嗎?如果您可以使用未排序的列表而不是表格,則可以使用CSS。見http://csswizardry.com/demos/multiple-column-lists/ –