Splitting foreach in a table

前端 未结 1 821
醉酒成梦
醉酒成梦 2020-12-22 12:59

As of right now my table looks like this:

But I want to split the foreach to have it look something like this

Is possible to do this?

And

1条回答
  •  孤城傲影
    2020-12-22 13:55

    You can use the following code to generate rows containing 9 columns

    @{var counter = 1; }
    
      @foreach (var date in ViewBag.MissingDays)
      {
        var isoDate = date.ToString("yy-MM-dd");
        @isoDate
        if (counter % 9 == 0)
        {
          @: // end current row and begin new one
        }
        counter++;
      }
    
    

    0 讨论(0)
提交回复
热议问题