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

159
Views
How to make cells automatcially go to a new row

I have a table that is 650px wide and I add words to this table...each word is in its own cell. However if I have too many words then it expands the table.
What I want to do is allow it to limit the X and auto go to a new row or under the current content so it doesn't resize the table.

I thought about calculating the width of each cell using JS..but it says each is 0px as the cells are created programmatically using JS.

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

0

Perhaps a table is not the best solution for you, since it doesn't have this functionality.

You could try simple <div>'s, they will wrap, but you could also have a look at the newer, and more advanced, Flexbox. Have a look at the Wrapping section on that page.

about 4 years ago · Juan Pablo Isaza Report

0

I got it work by using

 #tGrammar {
  display: block;
  }

 #tGrammar td {
  display: inline-block;
  }

in CSS

and in JS where is tChoicesMain is table

tChoicesMain.style.tableLayout = "fixed";
tChoicesMain.style.maxWidth = "650px";
tChoicesMain.setAttribute("id", "tGrammar");
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!