Hu Guys,

Sorry, my question might sound silly but how can I embbed a class inside

  echo "<tr><td><img src='data:image/jpeg;base64," . base64_encode($row['product_img']) . "' alt='' /></td></tr>";      

I tried

 echo '<div class="img"><tr><td><img src='data:image/jpeg;base64," . base64_encode($row['product_img']) . "' alt='' /></div></td></tr>';

But it's not working. Looks like I am doing something now quite right

Recommended Answers

All 3 Replies

Your tags are malformed - put the close div at the end.

Hi! In addition to Dave's suggestion, having a div between rows is not really correct:

<table>
    <tr>
        <td>

    <div class="img">
        <tr>
            <td><img src="..." />
    </div>

    <tr>
        <td>
</table>

Do:

<table>
    <tr>
        <td>

    <tr>
        <td><div class="img"><img src="..." /></div>

    <tr>
        <td>
</table>

Or simply:

<table>
    <tr>
        <td>

    <tr>
        <td><img class="img" src="..." />

    <tr>
        <td>
</table>

If necessary. Otherwise you can append the class to the td tag.

Thanks Guys!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.