Make bootstrap grid look like a table -


i have nice table layout wanna make responsive using bootstrap row, col.

excuse me using images illustrating purpose.

this how table looks like:

table

it's standard html table tr , td; when try use bootstrap first 2 rows , code:

<div class="row like-table" style="background-color:#f9f9f9;">     <div class="col-md-2">         <label for="txt_first_name">first name</label>     </div>     <div class="col-md-2">         <input type="text" name="txt_first_name" id="txt_first_name" value="<?php echo $var_firstname;?>">     </div>     <div class="col-md-2">         <label for="txt_last_name">last name</label>     </div>     <div class="col-md-2">         <input type="text" name="txt_last_name" id="txt_last_name" value="<?php echo $var_lastname;?>">     </div>     <div class="col-md-2">         <label for="gender">gender</label>     </div>     <div class="col-md-2">         <select name="gender" id="gender">             <option value="" <?php if($var_gender==''){ echo 'selected'; }?>>please select</option>             <option value="male" <?php if($var_gender=='male'){ echo 'selected'; }?>>male</option>             <option value="female" <?php if($var_gender=='female'){ echo 'selected'; }?>>female</option>             <option value="other" <?php if($var_gender=='other'){ echo 'selected'; }?>>other</option>         </select>     </div> </div> 

i don't neat table this:

table bootstrap

it seems col-md-1 narrow , col-md-2 wide first column , labels not align. can help?

thanks

it seems want 3 columns labels , inputs. can this:

<div class="row like-table">  <div class="col-md-4"> <div class="col-md-6"><label for="txt_first_name">first name</label></div> <div class="col-md-6"><input type="text" value="firstname"> </div> <div class="col-md-6"><label for="txt_birth_date">birth date</label></div> <div class="col-md-6"><input type="text" value=""> </div> </div>     <div class="col-md-4">       <div class="col-md-6"><label for="txt_last_name">last name</label>  </div>       <div class="col-md-6"><input type="text" value="">       </div>       <div class="col-md-6"><label for="txt_birth_date">hire date</label>  </div>       <div class="col-md-6"><input type="text" value="">       </div>       </div>     <div class="col-md-4">     <div class="col-md-6"><label for="gender">gender</label></div>     <div class="col-md-6"><select>       <option value="">please select</option>       <option value="male" >male</option>       <option value="female">female</option>       <option value="other">other</option>       </select>       </div>     <div class="col-md-6"><label for="txt_termination_date">termination date</label></div>     <div class="col-md-6"><input type="text" value="">   </div>    </div>     </div> 

Comments

Popular posts from this blog

node.js - Node js - Trying to send POST request, but it is not loading javascript content -

javascript - Replicate keyboard event with html button -

javascript - Web audio api 5.1 surround example not working in firefox -