Rowspan无法正确呈现行

Rowspan无法正确呈现行

本文介绍了Rowspan无法正确呈现行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 29岁程序员,3月因学历无情被辞! 我的Web应用程序中有以下视图。我无法正确使用rowspan。我无法找到我缺少的属性,以便将第三列中的行拆分为基于计数的数字。 我的计数有确切的属性数。只有两行正确呈现,最后一行不呈现。我也试过用@ :.但没有任何效果。 查看 @ foreach(var item在Model.OptionValues中) { < tr > < td rowspan = @ item.SetValue.Count > @ item.OptionVal < / td > < td rowspan = @ item.S etValue.Count > @ item.OptionValueID < / td > @ {var set = item.SetValue.FirstOrDefault(x => x.OptionValueID == item.OptionValueID);} @if(set!= null) { for(int i = 0; i < item.SetValue.Count; i ++) { < tr > < td > @ set.TcSet.SetName < / td > < td > @ set.Value < / td > < td > @ set.Status < / td > < / tr > } } < / tr > } 我没有在一列中正确渲染所有行。最后一行与主表一起显示。 解决方案 I have the following View in my Web Application. I am unable to use the rowspan properly. I can't find what property I am missing to get the row in the third column to split into the number based on the count.My count has the exact number of properties. only two rows are rendered properly and the last one is not rendered. I have also tried using @: . But nothing worked.View@foreach (var item in Model.OptionValues) { <tr> <td rowspan="@item.SetValue.Count" >@item.OptionVal</td> <td rowspan="@item.SetValue.Count">@item.OptionValueID</td> @{var set = item.SetValue.FirstOrDefault(x => x.OptionValueID == item.OptionValueID);} @if (set != null) { for (int i = 0; i < item.SetValue.Count; i++) { <tr> <td>@set.TcSet.SetName</td> <td> @set.Value</td> <td>@set.Status</td> </tr> } } </tr> }I am not getting all the rows rendered properly in a single column. the last row is shown along with the main table. 解决方案 这篇关于Rowspan无法正确呈现行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!
09-05 19:11