如果该列的描述太长,我想显示一个文本溢出:省略号。但是,我不确定为什么我的代码不起作用。我加了!重要的是,如果有一些内部 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....
Run Code Online (Sandbox Code Playgroud) 如果用户在提交表单时未选择任何选项,我想在 mat-radio-group 上添加验证。这就是我到目前为止所做的,但它不起作用。
<mat-radio-group formControlName="{{e.Index}}">
<mat-label>{{ et.Title }}</mat-label>
<mat-radio-button *ngFor="let tq of e.Items" [value]="tq" [checked]="tq.IsSelected">
{{tq.Name}}
</mat-radio-button>
</mat-radio-group>
Run Code Online (Sandbox Code Playgroud)
TS
elements.forEach((e, i) => {
case form.id: {
if (e.Required) {
a = { [name]: new FormControl('', Validators.required) };
} else {
a = { [name]: new FormControl('') };
}
etc ...
break;
}
}
Run Code Online (Sandbox Code Playgroud)