At first, I would wrap the line after 6 articles. In order to align it, I filled in spaces after each article. I found that I could fill in other matching articles, but I couldn’t fill in spaces.
Later I thought that this method is not very good. It seems that it can be controlled with css div. I am not familiar with this method. How should I do it? Can you help me write it down? ? Thank you
Below is my original method, I use c# razor view
<div> @foreach (var cat in Model.CateFather) { if (cat.IsMagazine.HasValue && cat.IsMagazine.Value) { @Html.ActionLink(cat.Name, "Magazine", "Lib",new { id = cat.ID }, new { target = "_blank", title = cat.Name }); //杂志类型 } else { @Html.ActionLink(cat.Name, "Category", "Lib", new { id = cat.ID }, new { target = "_blank", title = cat.Name }) //一般分类 } counter6 = counter6 + 1; if (counter6 % 6 == 0) { <br /> counter6 = 0; } else { int i = System.Text.Encoding.GetEncoding("gb2312").GetBytes(cat.Name).Length; string strSpace = ""; if (30 > i) { @strSpace.PadRight(30 - i, '-'); } } } </div>
Now I use div layout, and I have a new problem, look at the picture below
Why does the piece in the red box go to the right? I want it to be below
Please tell me How to write?
The following is html
Or do it yourself
Just add a