I am trying to list the record in the table side by side . First record in first column , Second Record Second column and so on until 6 record . So the view must be viewed 6 column list to show 6 record
my model
public class Order()
{
public string itemCode {get;set;}
public string itemName {get;set;}
}
public class OrderList()
{
public IEnumerable<Order> OrderList {get;set;}
}
In view
@model OrderList
@for (var i = 0; i < Model.Order.Count(); i++)
{
// how can I list the 6 records side by side please help
}
You post the same thread like
this thread.Not sure what is your whole code.Please be sure you have entirely
used my code.
Anyway,here is the other way you could refer to:
Model:
public class Order
{
[Key]
public long id { get; set; }
public DateTime OrderDate { get; set; }
public string Customer { get; set; }
public string Itemname { get; set; }
public int QTY { get; set; }
}
public class OrderList
{
public List<Order> OrderLists { get; set;}
}
public async Task<IActionResult> Index()
{
var model = new OrderList()
{
OrderLists = await _context.Order.ToListAsync()
};
return View(model);
}
Best Regards,
Rena
.NET forums are moving to a new home on Microsoft Q&A, we encourage you to go to Microsoft Q&A for .NET for posting new questions and get involved today.
Member
414 Points
1339 Posts
how to show the record side by side
Jul 15, 2020 09:35 PM|polachan|LINK
I am trying to list the record in the table side by side . First record in first column , Second Record Second column and so on until 6 record . So the view must be viewed 6 column list to show 6 record
my model
In view
All-Star
53641 Points
23994 Posts
Re: how to show the record side by side
Jul 15, 2020 10:38 PM|mgebhard|LINK
polachan, you've asked this question too many times... Please take the time to learn basic HTML/CSS and/or the Bootstrap grid system.
https://getbootstrap.com/docs/4.0/layout/grid/
Contributor
2720 Points
874 Posts
Re: how to show the record side by side
Jul 16, 2020 01:48 AM|Rena Ni|LINK
Hi polachan,
You post the same thread like this thread.Not sure what is your whole code.Please be sure you have entirely used my code.
Anyway,here is the other way you could refer to:
Model:
View:
Controller:
Best Regards,
Rena