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

116
Visualizações
Truncate String & Add Dots If overflowing

I'm trying to build a list with items containing meeting-information such as name, location, and date. one issue I'm coming up within REACT is that I would need a way to determine whether the string should add "..." to the meeting name where its truncated (if overflowing its container). The items are built with divs and p's and placed in a grid.

The only solution I've come up with is to create a lot of hidden <div> containing the subject enter image description here name and then slicing it repeatedly until the string and three dots would fit the container.

As per the below picture, I would like for the string to be "NIKEM SALES AND MARKET...".

below is the css i use at the moment for the cell:

.main-info {
    grid-area: main-info;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

image of meeting-item

about 4 years ago · Juan Pablo Isaza
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