固定行数中的元素 [英] Fixed number of elements in a row

查看:72
本文介绍了固定行数中的元素的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的下表中有一个连续值的列表问题是我想要这样做,以便连续只有5个单元格我不确定如何去做它我必须非常感谢使用CSS实现它或脚本任何帮助谢谢!



我尝试过:



这是我的JSFiddle [ ^ ]

I have the table below that had a list of values in a row the problem is that i want to make it so that there's only 5 cells in a row i'm not really sure how to go about it do i have to use CSS to achieve it or a script any help would be greatly appreciated thanks!

What I have tried:

Here is my JSFiddle[^]

推荐答案

每次索引成为a时,都可以启动一个新的表行5的倍数:



You can start a new table row every time the index becomes a multiple of 5:


.each(obj2 [key3], function (index){
if (index% 5 == 0 && index> 0 ){
bodyString + =(' < / tr>< tr>');
}
bodyString + =(' < td>' + obj2 [ key3] [index] + ' < / td>');
});
.each(obj2[key3], function(index) { if(index % 5 == 0 && index > 0){ bodyString += ('</tr><tr>'); } bodyString += ('<td>' + obj2[key3][index] + '</td>'); });


这篇关于固定行数中的元素的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆