0
In this code, the idea is to generate a list of records searching the database and showing in a cshtml the variables, for each item in this Model.
In the Database, strings contain \n
(line breaks) only that HTML.Displayfor does not break the line, the text is in one line.
I solved this problem with the tag <pre>
but then the font style is different.
There’s another way to make him use\n
? Or there’s another way to structure html to work?
<table id="tableRegistro" style="margin:0; width: 100%; border-collapse:collapse; border-spacing:0;" cellpadding="0" cellspacing="0">
<tbody>
@foreach (var item in Model.Objeto.ObjetoDetalhes.AsEnumerable().Where(x => x.Tipo.ToUpper() == "RESUMO DA VISITA"))
{
<tr class="row" style="border:0px;margin-left:0;width:50%">
<td style="margin-bottom: -3px; margin-top: -3px;font-size:15px">
@Html.DisplayFor(modelItem => item.Registro);
</td>
</tr>
}
</tbody>
</table>
tries to add this style
white-space: pre-line
in<td>
– Leandro Angelo
found out and was responding at the time. but thank you.
– Renato C.Francisco