我需要增加 ngx-bootstrap 工具提示的宽度,我已经尝试了所有我能找到的解决方案,但都没有成功。
HTML:
<a [tooltip]='acctTooltip' placement='bottom'>{{item.AccountNumber}}
...
<ng-template #acctTooltip>
<!--TODO: figure out how to get the tooltip width to widen-->
<div>
<table>
<tr>
<th>Title & Address:</th>
<td>
{{item.Title1}}<br /> {{item.Title2}}
<br /> {{item.Title3}}
<br />
</td>
</tr>
<tr>
<th>C/M:</th>
<td>{{item.CreditType}}</td>
</tr>
<tr>
<th>ServiceType:</th>
<td>{{item.ServiceType}}</td>
</tr>
<tr>
<th>Role:</th>
<td>{{item.Role[0].Capacity}}</td>
</tr>
</table>
</div>
</ng-template>
Run Code Online (Sandbox Code Playgroud)
[更新] 将它放在 style.css 中确实会导致它旋转 45 度(用于验证),背景可以缩小但不能扩展。所以在内部 html 中有更多的东西。
.tooltip.bottom {
border: 1px solid #e0e0e0;
border-bottom: none;
border-right: none;
max-width: none;
height: 10px;
transform: rotate(45deg);
background: white;
}
Run Code Online (Sandbox Code Playgroud)