Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

144
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!