Anonymous
Поле поиска и показать вход в замешанный стол jQuery с темой Bootstrap5
Сообщение
Anonymous » 13 фев 2025, 10:08
У меня есть некоторые проблемы с созданием простой данных с темой Bootstrap 5. Основная проблема заключается в том, что «Показать запись» и «строка поиска» смещены, а также часть страницы внизу таблицы (лучше всего можно увидеть на рисунке ниже). Я должен упомянуть, что если я использую другие стили, они выровнены. Проблема предназначена только для Bootstrap 5 тематических данных DataTables < /p>
picture < /p>
Я включил все необходимые плагины: < /p>
Код: Выделить всё
< /code>
HTML -часть для таблицы довольно просто: < /p>
ID
Judet
Localitate principala
Siruta superioara
Localitati apartenente
Sirute inferioare
Tipul solicitarii
Data intrare
Ultimul status
Utilizator
Deadline
< /code>
Таблица автоматической из базы данных SQL с использованием AJAX. Я не уверен, что это имеет значение, но я помесчу это здесь. < /P>
$(document).ready(function(){
var dataTable = $('#lista_proiecte').DataTable({
"processing": true,
"serverSide": true,
"order":[],
"ajax":{
url:"php/acasa_listaproiecte_fetch.php",
type:"POST",
},
"lengthMenu": [ [10, 25, 50, -1], [10, 25, 50, "All"] ],
createdRow:function(row, data, rowIndex)
{
$.each($('td', row), function(colIndex){
if(colIndex == 1)
{
$(this).attr('data-name', 'judet');
$(this).attr('class', 'judet');
$(this).attr('data-type', 'text');
$(this).attr('data-pk', data[0]);
}
if(colIndex == 2)
{
$(this).attr('data-name', 'localitate_principala');
$(this).attr('class', 'localitate_principala');
$(this).attr('data-type', 'text');
$(this).attr('data-pk', data[0]);
}
if(colIndex == 3)
{
$(this).attr('data-name', 'siruta_superioara');
$(this).attr('class', 'siruta_superioara');
$(this).attr('data-type', 'text');
$(this).attr('data-pk', data[0]);
}
if(colIndex == 4)
{
$(this).attr('data-name', 'localitati_apartenente');
$(this).attr('class', 'localitati_apartenente');
$(this).attr('data-type', 'text');
$(this).attr('data-pk', data[0]);
}
if(colIndex == 5)
{
$(this).attr('data-name', 'sirute_inferioare');
$(this).attr('class', 'sirute_inferioare');
$(this).attr('data-type', 'text');
$(this).attr('data-pk', data[0]);
}
if(colIndex == 6)
{
$(this).attr('data-name', 'tip_solicitare');
$(this).attr('class', 'tip_solicitare');
$(this).attr('data-type', 'text');
$(this).attr('data-pk', data[0]);
}
if(colIndex == 7)
{
$(this).attr('data-name', 'data_intrare');
$(this).attr('class', 'data_intrare');
$(this).attr('data-type', 'text');
$(this).attr('data-pk', data[0]);
}
if(colIndex == 8)
{
$(this).attr('data-name', 'ultimul_status');
$(this).attr('class', 'ultimul_status');
$(this).attr('data-type', 'text');
$(this).attr('data-pk', data[0]);
}
if(colIndex == 9)
{
$(this).attr('data-name', 'nume_utilizator');
$(this).attr('class', 'nume_utilizator');
$(this).attr('data-type', 'text');
$(this).attr('data-pk', data[0]);
}
if(colIndex == 10)
{
$(this).attr('data-name', 'deadline');
$(this).attr('class', 'deadline');
$(this).attr('data-type', 'text');
$(this).attr('data-pk', data[0]);
}
});
}
});
})
Подробнее здесь:
https://stackoverflow.com/questions/688 ... rap5-theme
1739430532
Anonymous
У меня есть некоторые проблемы с созданием простой данных с темой Bootstrap 5. Основная проблема заключается в том, что «Показать запись» и «строка поиска» смещены, а также часть страницы внизу таблицы (лучше всего можно увидеть на рисунке ниже). Я должен упомянуть, что если я использую другие стили, они выровнены. Проблема предназначена только для Bootstrap 5 тематических данных DataTables < /p> picture < /p> Я включил все необходимые плагины: < /p> [code] < /code> HTML -часть для таблицы довольно просто: < /p> ID Judet Localitate principala Siruta superioara Localitati apartenente Sirute inferioare Tipul solicitarii Data intrare Ultimul status Utilizator Deadline < /code> Таблица автоматической из базы данных SQL с использованием AJAX. Я не уверен, что это имеет значение, но я помесчу это здесь. < /P> $(document).ready(function(){ var dataTable = $('#lista_proiecte').DataTable({ "processing": true, "serverSide": true, "order":[], "ajax":{ url:"php/acasa_listaproiecte_fetch.php", type:"POST", }, "lengthMenu": [ [10, 25, 50, -1], [10, 25, 50, "All"] ], createdRow:function(row, data, rowIndex) { $.each($('td', row), function(colIndex){ if(colIndex == 1) { $(this).attr('data-name', 'judet'); $(this).attr('class', 'judet'); $(this).attr('data-type', 'text'); $(this).attr('data-pk', data[0]); } if(colIndex == 2) { $(this).attr('data-name', 'localitate_principala'); $(this).attr('class', 'localitate_principala'); $(this).attr('data-type', 'text'); $(this).attr('data-pk', data[0]); } if(colIndex == 3) { $(this).attr('data-name', 'siruta_superioara'); $(this).attr('class', 'siruta_superioara'); $(this).attr('data-type', 'text'); $(this).attr('data-pk', data[0]); } if(colIndex == 4) { $(this).attr('data-name', 'localitati_apartenente'); $(this).attr('class', 'localitati_apartenente'); $(this).attr('data-type', 'text'); $(this).attr('data-pk', data[0]); } if(colIndex == 5) { $(this).attr('data-name', 'sirute_inferioare'); $(this).attr('class', 'sirute_inferioare'); $(this).attr('data-type', 'text'); $(this).attr('data-pk', data[0]); } if(colIndex == 6) { $(this).attr('data-name', 'tip_solicitare'); $(this).attr('class', 'tip_solicitare'); $(this).attr('data-type', 'text'); $(this).attr('data-pk', data[0]); } if(colIndex == 7) { $(this).attr('data-name', 'data_intrare'); $(this).attr('class', 'data_intrare'); $(this).attr('data-type', 'text'); $(this).attr('data-pk', data[0]); } if(colIndex == 8) { $(this).attr('data-name', 'ultimul_status'); $(this).attr('class', 'ultimul_status'); $(this).attr('data-type', 'text'); $(this).attr('data-pk', data[0]); } if(colIndex == 9) { $(this).attr('data-name', 'nume_utilizator'); $(this).attr('class', 'nume_utilizator'); $(this).attr('data-type', 'text'); $(this).attr('data-pk', data[0]); } if(colIndex == 10) { $(this).attr('data-name', 'deadline'); $(this).attr('class', 'deadline'); $(this).attr('data-type', 'text'); $(this).attr('data-pk', data[0]); } }); } }); [/code] }) Подробнее здесь: [url]https://stackoverflow.com/questions/68813421/search-field-and-show-entry-misaligned-jquery-table-with-bootstrap5-theme[/url]