如何在水平方向上显示循环数据 [英] How to display for loop data in horizontally
本文介绍了如何在水平方向上显示循环数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在下面的脚本中垂直显示数据。我需要大声显示数据.Tab也无法正常工作。这是剑道模板
< script id = div-Template type = text / x-kendo-template>
# for ( var j = 1 ; j& lt; = SoldCount; j ++){#
< div id = ' box '>#= Plot - + j#< / div > < br />
& nbsp;
#}#
< / script>
请帮帮我。
谢谢你
我的尝试:
在上面的脚本中垂直显示数据。我需要大量显示数据.Tab也不能正常工作。这是剑道模板
$ / b
#for(var j = 1; j& lt; = SoldCount; j ++){#
< div id = 'box'>#=Plot - + j#< / div> < br />
& nbsp;
#}#
解决方案
这是更多一个HTML& CSS问题比剑道。
1您正在通过DIV显示您的内容,默认情况下是一个盒级元素。要覆盖它,您需要将其设置为内联元素。
2元素ID属性只能在文档中使用一次。您可以使用类解决此问题。
以下是您可以使用的HTML / CSS示例。
您将需要删除4个硬编码元素并将其替换为您的Kendo循环
< html >
< span class =code-keyword>< head >
< title > 测试< / title >
< style 类型 = text / css >
。 box { display : inline; width : 100px; }
< / style >
< / head >
< body >
< span class =code-keyword>< div class = box &克t; 方框1 < / div >
< div class = box > 方框2 < / div >
< div class = 框 > 方框3 < / div >
< div class = 框 > 方框4 < ; / div >
< / body >
< / html >
In below script display the data vertically .i need display the data in horzentically.Tab also not working.This is kendo template
<script id="div-Template" type="text/x-kendo-template">
# for(var j=1;j<=SoldCount;j++){#
<div id='box'>#="Plot -" + j # </div> <br />
# } #
</script>
pls help me.
thank u
What I have tried:
In above script display the data vertically .i need display the data in horzentically.Tab also not working.This is kendo template
# for(var j=1;j<=SoldCount;j++){#
<div id='box'>#="Plot -" + j # </div> <br />
# } #
解决方案
This is more of an HTML & CSS question than Kendo.
1 You are displaying your content via a DIV, which by default is a box level element. To override this you need to set it as an inline element.
2 An element ID attribute can only be used once within a document. You can fix this problem by using the class.
The following is an HTML/CSS sample for you to work with.
You will need to remove the 4 hard-coded elements out and replace it with your Kendo loop
<html> <head> <title>Test</title> <style type="text/css"> .box { display: inline; width: 100px; } </style> </head> <body> <div class="box">Box 1</div> <div class="box">Box 2</div> <div class="box">Box 3</div> <div class="box">Box 4</div> </body> </html>
这篇关于如何在水平方向上显示循环数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文