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
How to iterate on an array and print table in react

I want to iterate over an array and make a table row with its elements.
The coinlist is an array of object containing coin symbol and price. Is there any way to print table row with map function.

      <tbody>
            {coinlist.map((coin) => {
              return {
               
                 <tr>
                        <td>{coin.symbol}</td>
                        <td>{coin.price}</td>
                 </tr> 
            } })} 
        </tbody>
about 4 years ago · Santiago Gelvez
2 Respostas
Responde à pergunta

0

    <table>
      <tr>
        <th>Symbol</th>
        <th>Price</th>
       
      </tr>
     {coinlist.map(coin)=>(
 <tr>
        <td>{coin.symbol}</td>
        <td>{coin.price}</td>
       
      </tr>
))}
     
    </table>
about 4 years ago · Santiago Gelvez Relatório

0

If you want to print out the object fields which make up the table row you can either console.log the entire object which makes up the row or each individual field. Something along the lines of:

<tbody>
    {coinlist.map((coin) => {
        console.log(coin); // see the entire coin object
        console.log(`symbol: ${coin.symbol} price: ${coin.price}`); // see individual fields of interest
        return {  
            <tr>
               <td>{coin.symbol}</td>
               <td>{coin.price}</td>
             </tr> 
         } 
     })} 
</tbody>

Hopefully that helps

about 4 years ago · Santiago Gelvez 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