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

158
Visualizações
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 Respostas
Responde à pergunta

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 Relatório

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 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