Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

152
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda