diff --git a/src/BootstrapBlazor/Components/Table/Table.razor.cs b/src/BootstrapBlazor/Components/Table/Table.razor.cs index 96653667e04..8b71d314d81 100644 --- a/src/BootstrapBlazor/Components/Table/Table.razor.cs +++ b/src/BootstrapBlazor/Components/Table/Table.razor.cs @@ -1448,7 +1448,7 @@ private void ResetTableColumns() { DisplayName = col.GetDisplayName(), Name = col.GetFieldName(), - Width = col.Width, + Width = col.Fixed && !col.Width.HasValue ? DefaultFixedColumnWidth : col.Width, Visible = col.GetVisible(_screenSize) }; diff --git a/test/UnitTest/Components/TableTest.cs b/test/UnitTest/Components/TableTest.cs index 4652c53e943..295f1982f4c 100644 --- a/test/UnitTest/Components/TableTest.cs +++ b/test/UnitTest/Components/TableTest.cs @@ -1845,6 +1845,14 @@ public void ColumnFixed_Ok(bool showExtendButton, bool isFixedHeader) cut.Contains("left: 0px;"); cut.Contains("left: 200px;"); + var columns = cut.FindAll("th"); + var col = cut.FindAll("col"); + if (columns[0].ClassName == "fixed") + { + var fixedWidth = cut.FindAll("col")[0].OuterHtml.Contains("width: 200px"); + Assert.Equal("fixedWidth:True", $"fixedWidth:{fixedWidth}"); + } + if (showExtendButton) { if (isFixedHeader)