gpt4 book ai didi

html - 如何修复表格中的 CSS "White-space: nowrap"?

转载 作者:行者123 更新时间:2023-11-28 14:17:00 25 4
gpt4 key购买 nike

<分区>

如果描述对于列来说太长,我想显示一个文本溢出:省略号。但是,我不确定为什么我的代码不起作用。我加了!重要的是,如果有一些内部 CSS 文件可能覆盖了我的 CSS 内容。现在,描述中的文字全部添加到一行代码中,并扩展了400px的宽度。 [![说明列][1]][1]

 <div class="table-responsive">
<table class="table table-bordered" id="myTable" style="background-color:aqua">
<thead>
<tr style=" font-size: 18px;">
<th style="background-color:cadetblue; width:150px;">
@Html.DisplayNameFor(model => model.WorkOrderNumber)
</th>
</tr>
</thead>
<tbody>

@foreach (var item in Model)
{
//THIS LINE IS NOT WORKING
<td style="background-color:blueviolet; width:400px; white-space: nowrap !important; overflow: hidden !important; text-overflow: ellipsis !important; ">
@Html.DisplayFor(modelItem => item.Description)
</td>

etc....

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com