Bootstrap Table

by jimkennelly

HTML

<link rel="stylesheet" href="https://rawgit.com/wenzhixin/bootstrap-table/master/src/bootstrap-table.css">
<script src="https://rawgit.com/wenzhixin/bootstrap-table/master/src/bootstrap-table.js"></script>
<table data-toggle="table"
       data-url="/gh/get/response.json/wenzhixin/bootstrap-table/tree/master/docs/data/data1/">
    <thead>
    <tr>
        <th data-field="name" data-formatter="nameFormatter">Name</th>
        <th data-field="stargazers_count" data-formatter="starsFormatter">Stars</th>
      <th data-field="stargazers_count" >Stars</th>
        <th data-field="forks_count" data-formatter="forksFormatter">Forks</th>
        <th data-field="description">Description</th>
    </tr>
    </thead>
</table>

JavaScript

function nameFormatter(value) {
    return '<a href="https://github.com/wenzhixin/' + value + '">' + value + '</a>';
}

function starsFormatter(value) {
    return '<select onchange="test()">' 
    + '<option value="526">Orange</item>'
    + '  <option value="288">Apple</item>'
    + '  <option value="32">Pineapple</item>'
   + '  </select' + '<br>' + value;
   
    
}

function forksFormatter(value) {
    return '<i class="glyphicon glyphicon-cutlery"></i> ' + value;
}
function test(){
alert("value changed");
}