We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 21238ea commit 1c5b657Copy full SHA for 1c5b657
src/BootstrapBlazor/Components/Table/Table.razor.js
@@ -747,7 +747,10 @@ const autoFitColumnWidth = async (table, col) => {
747
const span = th.querySelector('.table-cell');
748
const thStyle = getComputedStyle(th);
749
const margin = parseFloat(thStyle.getPropertyValue('padding-left')) + parseFloat(thStyle.getPropertyValue('padding-right'))
750
- maxWidth = Math.max(maxWidth, calcCellWidth(span)) + margin;
+
751
+ //当 maxWidth 超过 列头span宽度 时,计算结果会额外的多出 margin 这个值
752
+ //应该是 maxWidth 与 (列头span宽度 + margin值)比较取最大
753
+ maxWidth = Math.max(maxWidth, calcCellWidth(span) + margin);
754
}
755
756
if (table.options.autoFitColumnWidthCallback !== null) {
0 commit comments