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

205
Visualizações
Turning an auto-expanding table row into a 'click to expand' row

I have a tablecompiled in Slim, which displays incoming messages in a row called 'events'.

My current issue is that this row automatically adjusts to expand to account for long messages, which creates a lopsided look if every 3rd message for example is quite long, but the rest are approximately one line of text.

I want to change this so that any string longer than 30 characters only displays the first line, and expands (aka reverts to it current format) upon clicking the row.

I however, can't think of the best way to approach this, and don't want to over-engineer a solution. What path would you suggest to achieve this?

table.slim

table.table.table-striped
thead.bg-white
  tr
    th = t('panel.home.show.event')
tbody.activities
  - @activities.each do |activity|
    tr
      - activity_cell = cell(:activity, activity)
      td.event
        == activity_cell.subtitle
        - if activity.deleted_by_slug.present?
          code == link_to(activity.deleted_by_slug, activity_cell.path(:deleted_by_slug))
      td
        == activity_cell.state
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