javascript - 如何使用边距自动 Css 角度 4 将跨度向左移动
问题描述
如何将那些突出显示的数字与名称一起向左移动。我已经尝试过 flex direction margin auto 等,但我无法得到想要的结果。
这是我的html代码
<section class="favorites">
<div class="category" *ngFor="let category of categoryKeys">
<div class="sub-header">{{category}}</div>
<app-custom-accordion [closeOthers]="true">
<ngb-panel [disabled]="panel.Tests.length === 0" *ngFor="let panel of testSelectionSession.FavoritesByCategory[category]"
id="{{panel.Id}}" [title] = "panel.Name">
<ng-template ngbPanelTitle>
<span class="test-length" style=""> {{ '(' + panel.Tests.length + ')'}}</span>
<div class="action-items">
<span class="icon-set" [ngClass]="{'same-day-2x': isSameDay(panel.Code), 'next-day-2x': isNextDay(panel.Code)}"></span>
<label class="custom-control custom-checkbox">
<input type="checkbox" class="custom-control-input" [name]="panel.Id + '-' + panel.Moniker" [ngModel]="checkAllTestsSelected(panel)"
(ngModelChange)="onPanelCheckboxUpdate($event, panel)" [id]="panel.Id + '-' + panel.Moniker">
<span class="custom-control-indicator"></span>
</label>
</div>
</ng-template>
</ngb-panel>
</app-custom-accordion>
我正在尝试将此标签移到左侧
<span class="test-length" style=""> {{ '(' + panel.Tests.length + ')'}}</span>
有人可以帮我解决这个问题吗?
解决方案
最简单的解决方案将包括
'(' + panel.Tests.length + ')'
在面板标题中:
<ngb-panel [disabled]="panel.Tests.length === 0" *ngFor="let panel of testSelectionSession.FavoritesByCategory[category]"
id="{{panel.Id}}" [title] = "panel.Name + '(' + panel.Tests.length + ')'">
该组件非常像一个表格,使单独列的内容向左浮动似乎很难实现。虽然我不熟悉ngb-panel
。
推荐阅读
- ios - iOS 应用的部署目标
- sql - 使用 SQL,是否可以使用引用该表的外键从不同的表(使用存储过程)中检索字段?
- css - 引导下拉菜单问题
- python - 同一函数中的 UnboundLocalError - Python
- python - 带有结构列的 Pyspark Parquet
- android - 在 ubuntu 18.04 中安装颤振时出错:“Android 许可证状态未知”
- android - 找不到 mainActivity 文件
- jquery - 如何在jquery中将数据序列化()和新的formData相互结合
- c++ - 如何在mac上的Cmake中链接libavformat?
- html - 为什么我的网格行/网格项隐藏,其中没有内容?