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

161
Visualizações
Match text and img in Datatables PHP

So, I'm generating some dummy data with FakerPHP

Either by generating data or manually putting it into my Datatables
Based on the BRAND of the car, id like to automatically display the right IMG

For example I generate 500 new rows of BRAND "AUDI"
and I want to auto display "AUDI.jpg"
In every column that BRAND is AUDI, display the logo picture as well.

What would be the optimal way to do this?
Example: https://i.imgur.com/vrP16ig.png

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

0

you can name logo picture same as brand name so that in picture column you can display logo base on brand name like the recontructed table below:

<table border="1">

                <thead>
                    <tr>

                        <th >BRAND</th>
                        <th >Model</th>
                        <th >Sub model</th>
                        <th >year</th>
                        <th >price</th>
                        <th >Photo</th>
                    </tr>
                </thead>
    
                <tbody>
                    <tr>
                        <td><?php echo $row['brand']; ?></td>
                        <td><?php echo $row['model']; ?></td>
                        <td><?php echo $row['submodel']; ?></td>
                        <td><?php echo $row['year']; ?></td>
                        <td><?php echo $row['price']; ?></td>
                        <td><img src="images/<?php echo $row['brand']; ?>.jpg" alt="" ></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