Skip to content

Commit ed5696d

Browse files
committed
Merge branch 'main' into dev-feature
2 parents 0820736 + a31fcaa commit ed5696d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/BootstrapBlazor/Components/Table/Table.razor.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -745,7 +745,9 @@ const autoFitColumnWidth = async (table, col) => {
745745
if (table.options.fitColumnWidthIncludeHeader) {
746746
const th = col.closest('th');
747747
const span = th.querySelector('.table-cell');
748-
maxWidth = Math.max(maxWidth, calcCellWidth(span));
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;
749751
}
750752

751753
if (table.options.autoFitColumnWidthCallback !== null) {

0 commit comments

Comments
 (0)