Is it possible to display a results array in a defined number of columns using only client side scripting?
I have an array of images/links that need to 开发者_StackOverflow社区be displayed in columns of 8 for however many rows there are, but I can not control this array.
Is it possible to format this using CSS/HTML (or as a last resort Javascript) so that a new row is created after x items is displayed?
Yes its very possible by using a fix sized container and css float property.
for e.g.
<div style="width:600px;">
<div style="width:200px;float:left;" >
your data here
</div>
</div>
You can create the similar code using javascript. Iterate throught the inner div container and after the 600px limit it will automatically start a new line.
精彩评论