0

I am rendering a DataTable with php, getting the data from a MySQL-Database.

The table get rendered, but the are columns in the table, which contain links of images (4th column) or links to other websites (on the 6th column). How can I render the links of the images, as images directly? And the links of the websites, as an Hypertext-Link not a text?

Here is my jquery code:

$(document).ready(function() {
    var dataTable = $('#oShopTab').DataTable( {
        "processing": true,
        "serverSide": true,
        "ajax":{
            url :"aPage-data.php", // json datasource
            type: "post"
        }
    });
});

HTML:

<table id="oShopTab" class="display">
    <thead>
        <tr>
            <th>pId</th>
            <th>sName</th>
            <th>lName</th>
            <th>logo Link</th>
            <th>Incentiv</th>
            <th>Go To Shop URL..</th>
        </tr>
    </thead>
    <tfoot>
        <tr>
            <th>pId</th>
            <th>sName</th>
            <th>lName</th>
            <th>logo Link</th>
            <th>Incentiv</th>
            <th>Go To Shop URL..</th>
        </tr>
    </tfoot>
</table>
2
  • <img src="<?= $the_image_link; ?>" /> and <a href="<?= $the_site_url ?>">Website</a>? Commented Jun 15, 2016 at 14:51
  • stackoverflow.com/a/3749664/4942980 Commented Jun 15, 2016 at 14:58

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.