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

113
Visualizações
Table react bootstrap component rendering from array

I want to render a Table component with N rows, where N corresponds to a given array lenght, and for each row there will be two columns: the 1st one with a parameter of the array of objects and the 2nd with the other parameter. How can i do that?
Here's a backbone

<Table>
            <thead>
                <tr>
                    <th>param #1</th>
                    <th>param #2</th>
                </tr>
            </thead>
            <tbody>
                ...for array.length-times...(
                <td>array[0].param1</td>
                <td>array[0].param2</td>
                ....)
            </tbody>
        </Table>
about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

As I understand your question, you can use a map() method to do that. Here is the sample code.

<Table>
  <thead>
    <tr>
      <th>param #1</th>
      <th>param #2</th>
    </tr>
  </thead>
  <tbody>
    {yourArray.map(arrayData=>{
    return(
    <tr>
      <td>arrayData.param1</td>
      <td>arrayData.param2</td>
    </tr>
    )
    }
    )}
  </tbody>
</Table>
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