RobW95
RobW95
CC#
Created by RobW95 on 6/12/2023 in #help
Html.DisplayName cutting off text
Changing to @Html.Label("", item.ToString()) fixed it
3 replies
CC#
Created by RobW95 on 6/12/2023 in #help
Html.DisplayName cutting off text
Surrounding code:
@model IndexModel
@{
ViewData["Title"] = "Home page";
}
<table>
<thead>
<tr>
@foreach (DataColumn column in Model._dataTable.Columns)
{
<td>
@Html.DisplayName(column.ColumnName)
</td>
}
</tr>
</thead>
<tbody>

@foreach (DataRow row in Model._dataTable.Rows)
{
<tr>
@foreach (var item in row.ItemArray){
<td>
@Html.DisplayName(item.ToString())
</td>
}
</tr>
}
</tbody>
</table>
@model IndexModel
@{
ViewData["Title"] = "Home page";
}
<table>
<thead>
<tr>
@foreach (DataColumn column in Model._dataTable.Columns)
{
<td>
@Html.DisplayName(column.ColumnName)
</td>
}
</tr>
</thead>
<tbody>

@foreach (DataRow row in Model._dataTable.Rows)
{
<tr>
@foreach (var item in row.ItemArray){
<td>
@Html.DisplayName(item.ToString())
</td>
}
</tr>
}
</tbody>
</table>
3 replies