diff --git a/public/app.js b/public/app.js index bc12259..89292b2 100644 --- a/public/app.js +++ b/public/app.js @@ -415,13 +415,18 @@ async function selectTable(schema, tableName) { } // ✅ Формируем колонки с правильными редакторами - const columns = [ + const columns = [ { formatter: "rowSelection", titleFormatter: "rowSelection", hozAlign: "center", + headerHozAlign: "center", // ✅ Выравнивание заголовка headerSort: false, - width: 40, + width: 40, // ✅ Фиксированная ширина + minWidth: 40, // ✅ Минимальная ширина + maxWidth: 40, // ✅ Максимальная ширина + resizable: false, // ✅ Запрещаем изменение размера + frozen: true, // ✅ Опционально: зафиксировать при прокрутке cellClick: function(e, cell) { e.stopPropagation(); cell.getRow().toggleSelect(); @@ -562,11 +567,14 @@ async function selectTable(schema, tableName) { selectableRowsCheck: function(row) { return true; }, columns: columns, - layout: "fitDataStretch", // ✅ Изменено - растягивает столбцы для заполнения + подгоняет под данные + layout: "fitDataStretch", resizableColumns: true, resizableColumnFit: false, - columnMinWidth: 100, + columnMinWidth: 100, // ✅ Применяется ко всем столбцам кроме явно указанных + columnDefaults: { // ✅ Дефолтные параметры для всех столбцов + resizable: true + }, pagination: true, paginationMode: "remote", diff --git a/public/index.html b/public/index.html index 8f36868..5fc3a75 100644 --- a/public/index.html +++ b/public/index.html @@ -255,7 +255,7 @@ color: #b3e5fc; font-style: normal; } -/* ✅ Синхронизация ширины заголовков и столбцов */ + /* ✅ Синхронизация ширины заголовков и столбцов */ .tabulator { border: none; background-color: white; @@ -265,11 +265,6 @@ .tabulator .tabulator-header { background-color: #f5f5f5; border-bottom: 2px solid #ddd; - overflow: visible !important; /* Важно для синхронизации */ - } - - .tabulator .tabulator-header .tabulator-col { - background-color: #f5f5f5; } .tabulator .tabulator-tableholder { @@ -279,18 +274,48 @@ .tabulator .tabulator-table { width: auto !important; } - - /* ✅ Минимальная ширина столбцов */ + + /* ✅ Минимальная ширина столбцов (кроме служебных) */ .tabulator-col { min-width: 100px !important; } - /* ✅ Фиксируем первый столбец с чекбоксами */ + /* ✅ ИСКЛЮЧЕНИЕ: столбец с чекбоксами - фиксированная ширина */ + .tabulator-col.tabulator-row-handle { + width: 40px !important; + min-width: 40px !important; + max-width: 40px !important; + } + .tabulator-col[tabulator-field=""] { width: 40px !important; min-width: 40px !important; max-width: 40px !important; } + + /* ✅ Заголовок столбца с чекбоксами */ + .tabulator-header .tabulator-col.tabulator-row-handle, + .tabulator-header .tabulator-col[tabulator-field=""] { + width: 40px !important; + min-width: 40px !important; + max-width: 40px !important; + flex: 0 0 40px !important; + } + + /* ✅ Ячейки столбца с чекбоксами */ + .tabulator-cell[tabulator-field=""], + .tabulator-row .tabulator-cell:first-child { + width: 40px !important; + min-width: 40px !important; + max-width: 40px !important; + padding: 4px !important; + } + + /* ✅ Чекбокс внутри ячейки */ + .tabulator-row-handle { + width: 40px !important; + } +