Search code examples
labelbootstrap-table

Using Bootstrap Labels in Bootstrap tables


I'm trying to add a bootstrap label to a <th> field I have in bootstrap-table that I have so that I can get the results of the fields to display in a label. What's the best way to approach this? Putting the <span> inside the <th> doesn't yield the desired result. I'd just like the results to be labels - is this possible?

    <table id="medicationtable">
    <thead>
    <tr>
        <th data-field="Medication_Name">Medication Name</th>
        <th data-field="Read_Code">Read Code</th>
        <th data-field="Dose">Dose</th>
        <th data-field="Date_Started">Date Started</th>
        <th data-field="Date_Ended">Date Ended</th>
    </tr>
    </thead>
</table>

Solution

  • I don't think it's possible if you're generating the table from remote data. If you want to add additional html into the cells generated, you'd need to apply bootstrap-table to an already existing table in the html.

    http://issues.wenzhixin.net.cn/bootstrap-table/#options/from-html.html