Center the last row of the PoS screen

This commit is contained in:
nicolas.dorier 2018-04-27 00:00:32 +09:00
parent 4f9e4116a2
commit 1fa1b74261

View File

@ -19,9 +19,11 @@
<h1 class="mb-4">@Model.Title</h1> <h1 class="mb-4">@Model.Title</h1>
<form method="post"> <form method="post">
<div class="row"> <div class="row">
@foreach(var item in Model.Items) @for(int i = 0; i < Model.Items.Length; i++)
{ {
<div class="col-sm-4 mb-3"> var className = (Model.Items.Length - i) > (Model.Items.Length % 3) ? "col-sm-4 mb-3" : "col align-self-center";
var item = Model.Items[i];
<div class="@className">
<h3>@item.Title</h3> <h3>@item.Title</h3>
<button type="submit" name="choiceKey" class="btn btn-primary" value="@item.Id">Buy for @item.Price.Formatted</button> <button type="submit" name="choiceKey" class="btn btn-primary" value="@item.Id">Buy for @item.Price.Formatted</button>
</div> </div>