Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/83.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/33.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html 在_Html_Css_Asp.net Mvc - Fatal编程技术网

Html 在

Html 在,html,css,asp.net-mvc,Html,Css,Asp.net Mvc,我正在显示一个从数据库到视图的表 @model IEnumerable<test1.Models.Malfunction> @{ ViewBag.Title = "Malfunctions"; } <h2>Malfunctions</h2> <table id="customers" class="table table-bordered table-hover"> <thea

我正在显示一个从数据库到视图的表

@model IEnumerable<test1.Models.Malfunction>
@{ 
ViewBag.Title = "Malfunctions";
}

<h2>Malfunctions</h2>

<table id="customers" class="table table-bordered table-hover">
<thead>
    <tr>
        <th>ID</th>
        <th>Description</th>
        <th>Date Reported</th>
        <th>Customer</th>
        <th>Movie</th>
    </tr>
</thead>
<tbody>
    @foreach (var malfunction in Model)
    {
        <tr>
            <td>@malfunction.Id</td>
            <td>@malfunction.ReportDescription</td>
            <td>@malfunction.DateReported</td>
            <td>@malfunction.Customer</td>
            <td>@malfunction.Movie</td>
        </tr>
    }
</tbody>
</table>
此属性:

<td>@malfunction.ReportDescription</td>
可以包含大量文本,如果太长,将与行中的下一个属性重叠,即:

<td>@malfunction.DateReported</td>
我要做的是在达到单元格宽度后断开该行,这样它就不会与DateReported中的文本重叠。

添加:

td {
  word-break: break-all;
}
加:


您可以使用任何前端框架或标记在元素的下一行;要断行。@只需编写代码,将其添加到何处,不起作用您可以使用任何前端框架或标记在元素的下一行。使用单词break:break all;要断行。@只需编写代码,将其添加到何处,不起作用吗?在哪里添加,不会将其添加到CSS中。请参阅答案底部的链接。你可以看到它在工作。在哪里添加它,不会将其添加到CSS中。请参阅答案底部的链接。你可以看到它在工作。