Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

150
Visualizações
Bootstrap DataTable is not responsive

I have this Bootstrap DataTable, with the following HTML and Javascript code, without any additional CSS. Following the documentation, I tried to insert the various responsive operations inside the Javascript code, but nothing seems to work. The table does not shrink with the page and does not flex. All the additional links have been imported, so I don't really understand where the problem might be.:

$(document).ready(function() {
    $("#feedback").DataTable({
        aaSorting: [],
        responsive: true,
        columnDefs: [
            {
                responsivePriority: 1,
                targets: 0
            },
            {
                responsivePriority: 2,
                targets: -1
            }
        ]
    });
    $('[data-toggle="tooltip"]').tooltip();
} );
<div id="div-feedback" class="container">
              <div class="row py-5">
                  <div class="col-12">
                        <table id="feedback" class="table table-striped table-bordered responsive" style="width: 100%;">
                        <thead>
                            <tr>
                                <th>#ID</th>
                                <th>Titolo</th>
                                <th>Commento</th>
                                <th>Valutazione</th>
                                <th>Azione</th>
                             </tr>
                        </thead>
                <tbody>
                    <% 
                        if ( feedback != null &&  feedback.size() != 0) {
                                    for ( FeedbackBean  fb: feedback) {
                            %>
                    <tr>
                        <td><%=fb.getIdFeedback() %></td>
                        <td><%=fb.getTitolo() %></td>
                        <td><%=fb.getCommento() %></td>
                        <td><%=fb.getValutazione() %></td>
                        <td><button type="button" class="btn bg-cart">Elimina</button></td>
                    </tr>
                  <%}} %>
                </tbody>
                    </table>
                </div>
            </div>
        </div>

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

you have to give responsive class parent container

<div class="table-responsive">
<table class="table table-striped table-bordered">...</table>
</div>

<div id="div-feedback" class="container">
  <div class="table-responsive">
    <table id="feedback" class="table table-striped table-bordered">
      <thead>
        <tr>
          <th>#ID</th>
          <th>Titolo</th>
          <th>Commento</th>
          <th>Valutazione</th>
          <th>Azione</th>
        </tr>
      </thead>
      <tbody>
        <% 
                        if ( feedback != null &&  feedback.size() != 0) {
                                    for ( FeedbackBean  fb: feedback) {
                            %>
          <tr>
            <td>
              <%=fb.getIdFeedback() %>
            </td>
            <td>
              <%=fb.getTitolo() %>
            </td>
            <td>
              <%=fb.getCommento() %>
            </td>
            <td>
              <%=fb.getValutazione() %>
            </td>
            <td><button type="button" class="btn bg-cart">Elimina</button></td>
          </tr>
          <%}} %>
      </tbody>
    </table>
  </div>
</div>

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda