Adding a link in bootstrap-table

Chan picture Chan · Jan 7, 2015 · Viewed 14.9k times · Source

I want to add a link to a column in bootstrap-table. How to do this?

Answer

William Weatherby picture William Weatherby · Jun 4, 2015

In your HTML table:

<th data-field="snum" data-formatter="LinkFormatter">Computer</th>

in your javascript:

function LinkFormatter(value, row, index) {
  return "<a href='"+row.url+"'>"+value+"</a>";
}