I have a grid using twitter bootstrap that we are converting from a table. Ordinarily we would consider this tabular data and just use a table but we have to (client requirements) be able to reliably print the table and given the bag of hurt printing log tables is, I’m migrating to bootstrap grids.
What I need to be able to simulate is the rowspan that we’re currently using in the table.
Note I’m using a custom bootstrap with a grid of 10 cols because of size constraints
JS Fiddle of example http://jsfiddle.net/dstarh/hKjEM/
<div class="container">
<div class="row">
<div class="span1">Date</div>
<div class="span2" style="text-align:center;">Total Time</div>
<div class="span1" style="text-align:right;">Time of activity</div>
<div class="span1" style="text-align:left;">Time of Day</div>
<div class="span1" style="text-align:right;">Distance</div>
<div class="span4" style="text-align:left;">Description</div>
</div>
<div class="row">
<div class="span3">
<div class="row">
<div class="span1" style="height:100%;">01/31/2013</div>
<div class="span2" style="height:100%;">8 hours/12 miles
<hr> <span class="target-calories">
TARGET 15 miles
</span>
</div>
</div>
</div>
<div class="span7">
<div class="row">
<div class="span1" style="text-align:right;">1 hour</div>
<div class="span1" style="text-align:left;">morning</div>
<div class="span1" style="text-align:right;">3 miles</div>
<div class="span4" style="text-align:left;">ran 3 miles</div>
</div>
<div class="row">
<div class="span1" style="text-align:right;">1 hour</div>
<div class="span1" style="text-align:left;">noon</div>
<div class="span1" style="text-align:right;">2 miles</div>
<div class="span4" style="text-align:left;">walked 2 miles</div>
</div>
<div class="row">
<div class="span1 offset2" style="text-align:right;">2 miles</div>
<div class="span4" style="text-align:left;">biked 2 miles</div>
</div>
<div class="row">
<div class="span1 offset2" style="text-align:right;">4 miles</div>
<div class="span4" style="text-align:left;">ran 4 miles</div>
</div>
<div class="row">
<div class="span1" style="text-align:right;">4 miles</div>
<div class="span1" style="text-align:left;">night</div>
<div class="span1" style="text-align:right;">4 miles</div>
<div class="span4" style="text-align:left;">ran 4 miles</div>
</div>
</div>
</div>
</div>
I need the first two columns (inside the span3) to be vertically centered next to the rest of the columns/rows ). The number of rows on the right (in the span 7) is random, anywhere from 1 to likely 10-15 on the high end.
This should get you close. You do have to stretch the frame wide enough to allow responsive to do its thing. Note that vertical alignment is a challenge in itself and may require a nested table or JavaScript solution (see below).
http://jsfiddle.net/WfDUY/4/
Here’s an example with the nested table solution: http://jsfiddle.net/WfDUY/6/