开发者

DataList help - MVC 2

开发者 https://www.devze.com 2023-03-02 04:48 出处:网络
Here\'s the scenario: I\'m doing a website for a Taxidermy company and am working on the procelist. After looking at some ideas I wrote a DataList class to mimich the ASP.NET DataList. In most cases

Here's the scenario:

I'm doing a website for a Taxidermy company and am working on the procelist. After looking at some ideas I wrote a DataList class to mimich the ASP.NET DataList. In most cases it works perfectly, except this one.

Here's the code causing the trouble:

<table id="priceList" cellpadding="5" cellspacing="5">
    <% Html.DataList(Model.AnimalPrices).Columns(7).Item(item =>
    {
        item.Template(galleryImage =>  
    {%>
        <tr  style="margin-right:35px; line-height:150%;">
            <td><%=galleryImage.TypeName %></td>  
        </tr> 
        <tr>
            <td><%=galleryImage.MountPrice %></td>
        </tr>
    <%});                         
}).Render(); %>
</table>

The list is supposed to go horizontally but because the way I have it set up it's going vertically. So in each loop it creates a new row, thus causing it to go vertical. Anone got and ideas how I ca开发者_StackOverflown change that and make it display horizontally ?

If you need the code for the DataList I can provide it but keep in mind it's a lot of code


tr = Table Row.. Which would cause your columns to stack on top of each other.

You would like to create one row, and add multiple columns to it. it may require a nested loop to ad a single row to column ratio.

0

精彩评论

暂无评论...
验证码 换一张
取 消