Tech
Forums
Jobs
Books
Events
Videos
Conference
Annual Conference
Bcrypt
Ai Conference
Live
More
Interviews
Certification
Training
Career
Members
News
Blogs
Contribute
An Article
A Blog
A Video
An Ebook
An Interview Question
Register
Login
3
Answers
How to display three columns in a table in MVC
Ask a question
Ask a question
Upload Source Code:
Select only zip and rar file.
ashok kumar
10y
1.6k
1
Reply
Hi
This is really challenging, i want to display three columns in a table,pls see the code iam using MVC and Razor.
here each item is rendered and displayed like this
Item1
Item2
item3
item4
item5
item6
my requirement i have to display it.
Item1 Item2 Item3
Item4 Item5 Item6
on every 3 row an tr should be inserted i guess,pls suggest me an solution sitting with this for two days.
My View:
@foreach(var item in Model.Products)
{
if(i%3==0)
{
<img src="data:image;base64,@System.Convert.ToBase64String(item.PRoductImage)" height="10px" width="200px" id="test" onclick="testing();" />
<button id="btn" type="button" title="BTN" onclick="Add(@item.Id);"></button>
}
else
{
<img src="data:image;base64,@System.Convert.ToBase64String(item.PRoductImage)" height="10px" width="200px" id="tests" onclick="testing();" />
<button id="btns" type="button" title="BTN" onclick="Add(@item.Id);"></button>
}
i += 1;
}
Post
Reset
Cancel
Answers (
3
)
Next Recommended Forum
how to get hidden value in javescript
Interest Calculations part in asp.net