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

135
Visualizações
horizontally align a list of components in react.js

I have to align components rendered using a map function horizontally as its default align vertically.

Here's my component:

                <Table.Cell>
                 {[...Array(this.props.numPages)].map((e, i) => (
                   <Typography customLink onClick={() => this.handlePageClick(i + 1)} key={'key'.concat(i)} className='pages'>
                     {i + 1}
                   </Typography>
                 ))}
               </Table.Cell>

Here Typography is the component which have to be rendered as page numbers but its getting rendered vertically.

Here's the css I used:

.pages{
    display: flex;
    flex-direction: horizontal;
  }

Any help will be appreciated.

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

It's the wrapper who need to be flex, and flex direction horizontal do not exists...

Try with this maybe :

            <Table.Cell>
              <div style={{display:'flex', flexDirection:'row'}}>
             {[...Array(this.props.numPages)].map((e, i) => (
               <Typography customLink onClick={() => this.handlePageClick(i + 1)} key={'key'.concat(i)} className='pages'>
                 {i + 1}
               </Typography>
             ))}
             </div>
           </Table.Cell>
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