<table>
@for (int i = 0; i < ViewBag.MyItems.Count; i++)
{
var cells = 4;
var item = ViewBag.MyItems[i];
if ((i % cells) == 0)
{
@:<tr>
}
<td>
@item.MyTextOrWhatever
</td>
if (i == (ViewBag.MyItems.Count - 1))
{
while ((i % cells) != 0)
{
@:<td></td>
i++;
}
}
if ((i % cells) == (cells - 1)) // aka: last row cell
{
@:</tr>
}
}
</table>
This was all about Scenario's which I involved in my profession.
Friday, 22 March 2019
Create new table row for every 4th loop
Subscribe to:
Comments (Atom)
Extracting Nupkg files using command line
Rename it to zip first then extract files as below 1. Rename-Item -Path A_Package.nupkg -NewName A_Package.zip 2. Make sure to repla...
-
Rename it to zip first then extract files as below 1. Rename-Item -Path A_Package.nupkg -NewName A_Package.zip 2. Make sure to repla...
-
Getting-started Bootstrap Components Grid Positioning
-
Please follow the below URL to get started: Sitecore Helix Visual Studio Templates - Visual Studio Marketplace