twitter bootstrap 3 - Bootstrap3 - ensuring data grouped correctly in responsive grid -


i trying achieve following layout in bootstrap 3, converting old table based layout bootstrap's responsive grid:

label1a: value1a    label2: value2 label1b: value1b    label3: value3 label1c: value1c    label4: value4 

with 1a through c being related data needs grouped together, in case address data, e.g.

address1: [data1]    contact:  joe bloggs town:     [data2]    position: developer 

etc.

problem have @ smaller viewports want address data remain displayed in single section rather interspersed other data, i.e.

address1: [data1] town:  [data2] contact: joe bloggs position: developer 

but coming out

address1: [data1] contact: joe bloggs town:  [data2] position: developer 

this not surprising given code:

                    <div class="row">                                                       <label for="address" class="control-label col-sm-2">address:</label>                                  <div class="col-sm-4"><%# databinder.eval(container.dataitem, "address1")%> <%# databinder.eval(container.dataitem, "address2") %></div>                                                       <label for="contact" class="control-label col-sm-2">contact:</label>                                  <div class="col-sm-4"><%# databinder.eval(container.dataitem, "name")%></div>                                                                       </div>                           <div class="row">                              <label for="town" class="control-label col-sm-2">town:</label>                                  <div class="col-sm-4"><%# databinder.eval(container.dataitem, "address3")%></div>                              <label for="position" class="control-label col-sm-2">position:</label>                                  <div class="col-sm-4"><%# databinder.eval(container.dataitem, "position")%></div>                                               </div> 

this must common scenario simple. can workaround , change layout know how best achieve in bootstrap. thanks.

you can using row 2 columns. 1 column address info, other column remaining info.

then using bootstrap's built in form layout, can have text drop below label automatically on mobile devices.

here's example bootply: http://www.bootply.com/l2lxfk0bcv

<div class="row">   <div class="col-sm-6 form-horizontal">     <div class="form-group">       <label class="control-label col-sm-2">address 1</label>       <div class="col-sm-10">         <p class="form-control-static">123 main st</p>       </div>     </div>     <div class="form-group">       <label class="control-label col-sm-2">town</label>       <div class="col-sm-10">         <p class="form-control-static">london</p>       </div>     </div>   </div>   <div class="col-sm-6 form-horizontal">     <div class="form-group">       <label class="control-label col-sm-2">contact</label>       <div class="col-sm-10">         <p class="form-control-static">joe bloggs</p>       </div>     </div>     <div class="form-group">       <label class="control-label col-sm-2">position</label>       <div class="col-sm-10">         <p class="form-control-static">developer</p>       </div>     </div>   </div> </div> 

Comments

Popular posts from this blog

java - Custom OutputStreamAppender not run: LOGBACK: No context given for <MYAPPENDER> -

java - UML - How would you draw a try catch in a sequence diagram? -

c++ - No viable overloaded operator for references a map -