Adrian Asked:2020-05-04 17:49:16 +0000 UTC2020-05-04 17:49:16 +0000 UTC 2020-05-04 17:49:16 +0000 UTC @Html.DisplayFor -- 额外的空行和空白字符 772 视图中有一段代码: <td style="word-wrap:break-word; white-space:pre-line"> @Html.DisplayFor(model => Model.Checks[i].Value) </td> 这个案例是这样呈现的: 问题:如何去除文本前的空行?都已经筋疲力尽了。 PS 随着white-space:pre-wrap更多的空白字符出现,它看起来像这样: html 1 个回答 Voted Best Answer MihailPw 2020-05-04T18:02:53Z2020-05-04T18:02:53Z 像这样写: <td style="word-wrap:break-word; white-space:pre-line">@Html.DisplayFor(model => Model.Checks[i].Value)</td> 如果你写white-space:pre-line了 ,你必须考虑到这个字符将被显示: <td style="word-wrap:break-word; white-space:pre-line">=> @Html.DisplayFor(model => Model.Checks[i].Value) </td> Where =>- 转换到新行。
像这样写:
如果你写
white-space:pre-line了 ,你必须考虑到这个字符将被显示:Where
=>- 转换到新行。