Skip to content

Commit 541b0cc

Browse files
committed
feat: 多选列增加默认居中逻辑
1 parent 28cb8d0 commit 541b0cc

2 files changed

Lines changed: 8 additions & 2 deletions

File tree

src/BootstrapBlazor/Components/Table/Table.razor.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Licensed to the .NET Foundation under one or more agreements.
1+
// Licensed to the .NET Foundation under one or more agreements.
22
// The .NET Foundation licenses this file to you under the Apache 2.0 License
33
// See the LICENSE file in the project root for more information.
44
// Maintainer: Argo Zhang(argo@live.ca) Website: https://www.blazor.zone
@@ -97,6 +97,7 @@ public partial class Table<TItem> : ITable, IModelEqualityComparer<TItem> where
9797
.AddClass("table-resize", AllowResizing)
9898
.AddClass("table-fixed-body", RenderMode == TableRenderMode.CardView && IsFixedHeader)
9999
.AddClass("table-striped table-hover", ActiveRenderMode == TableRenderMode.CardView && IsStriped)
100+
.AddClass("table-multi", IsMultipleSelect)
100101
.Build();
101102

102103
private string? FooterClassString => CssBuilder.Default("table-footer")

src/BootstrapBlazor/Components/Table/Table.razor.scss

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.table-container {
1+
.table-container {
22
--bb-table-td-padding-x: .5rem;
33
--bb-table-td-padding-y: .5rem;
44
--bb-table-cardview-label-width: 30%;
@@ -44,6 +44,11 @@
4444
overflow: auto;
4545
}
4646
}
47+
48+
.table-multi th:first-child > .table-cell,
49+
.table-multi td:first-child > .table-cell {
50+
justify-content: center;
51+
}
4752
}
4853

4954
.table-container .table:not(.table-excel) .switch {

0 commit comments

Comments
 (0)