responsive design - How to use Bootstrap 3 grid system with table component? -
i have started migration grid system using bootstrap 3, examples in documentation using divs: http://getbootstrap.com/css/#grid
i made redundant code mixes div classes table tags/classes: http://getbootstrap.com/css/#tables
the problem layout dobles borders , think should better way of doing that. recommendations on that?
an example code in fiddle: http://jsfiddle.net/7g8nv/1/
<div class="table-responsive"> <table class="table table-bordered"> <tr class="row"> <td class="field-label col-md-3 active"> <label>field 1:</label> </td> <td class="col-md-9"> value 1 </td> </tr> <tr class="row"> <td class="field-label col-md-3 active"> <label>field 2:</label> </td> <td class="col-md-9"> value 2 </td> </tr> <tr class="row"> <td class="field-label col-md-3 active"> <label>field 3:</label> </td> <td class="col-md-9"> value 3 </td> </tr> </table> </div>
thanks in advance.
remove row
class <tr>
elements. class makes non-table-row element table-row , adds styles break standard <tr>
. can still use "col" classes normal:
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css"> <table class="table table-bordered"> <tr> <td class="field-label col-xs-3 active"> <label>field 1:</label> </td> <td class="col-md-9"> value 1 </td> </tr> <tr> <td class="field-label col-xs-3 active"> <label>field 2:</label> </td> <td class="col-md-9"> value 2 </td> </tr> <tr> <td class="field-label col-xs-3 active"> <label>field 3:</label> </td> <td class="col-md-9"> value 3 </td> </tr> </table>
Comments
Post a Comment