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

134
Views
Dynamic column arrangement in bootstrap grid (bootstrap+vanilla js)

I am creating a grid (so something with rows and columns with buttons in the cells) and a slider that should alter the number of columns.

The number of rows is virtually unlimited and, since the grid layout in bootstrap is implemented with a flexbox i should either swap column classes or redraw everything every onchange event.

is there another way in bootstrap or do i need to create a grid layout from scratch and alter the column layout each time?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

i managed to do that by adding a counter of elements inside a row and whenever i reach the desired element number i append a new row and start adding elements to the last row

like so

   if(indexofrow%element.getColNumber()==0){
            indexofrow++;
            document.getElementById("canvas").insertAdjacentHTML("beforeend","<div class='row flex-nowrap'/></div>");
            drawSingleButton(i,element,arrayOfLayers);
        }else{
            drawSingleButton(i,element,arrayOfLayers);
            indexofrow++;
   }

it's probably a cheap workaround but for my case it works

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!