Make all data in a column to a hyperlink ()
Make all data in a column to a hyperlink ()
![runner](https://secure.gravatar.com/avatar/8187673b12f158c0f28dcc7fd9795b54/?default=https%3A%2F%2Fvanillicon.com%2F8187673b12f158c0f28dcc7fd9795b54_200.png&rating=g&size=120)
Hi!
I'm using the following code to fetch data using PHP from a MySQL database which works just fine:
$('#my-table').dataTable({
"bProcessing": true,
"sAjaxSource": "pro.php",
"aoColumns": [
{ mData: 'id' } ,
{ mData: 'username' },
{ mData: 'domain' },
]
});
All the data in the domain column are domain name (eg. example.com) and i want them to be rendered inside an anchor tag element <a href="example.com">blah</a>.
Is that possible to do with the Javascript code I use above?
I've tried looking in to the render documentation but don't really get it. Any help would be appreciated.
Thanks!
This discussion has been closed.
Replies
Hi @runner ,
Take a look at the fourth example on
columns.render
, that's doing exactly what you're after,Cheers,
Colin