I have a php application for a cookbook site. To make this application responsive for all devices, I need to convert the listing of ingredients from a table format to div's but I am having a challenge with how to set-up the div structure and css.
To better explain what I have presently and what I want, kindly click here.
This is a typical block of recipe ingredients:
<table id="recipe">
<tr>
<td class="ingramt">2½</td>
<td class="ingred">cups flour</td>
<td class="ingramt">1 tbsp</td>
<td class="ingred">baking powder</td>
</tr>
<tr>
<td class="ingramt">½ cup</td>
<td class="ingred">butter or shortening</td>
<td class="ingramt">1</td>
<td class="ingred">egg</td>
</tr>
<tr>
<td class="ingramt">1 tsp</td>
<td class="ingred">salt</td>
<td colspan="2" class="merged">some milk</td>
</tr>
</table>
As you can see from the mark-up, I have four table columns to create two columns of data. For higher resolutions I want the div's and css to render the appearance much the same as the table method. Using media queries in the css for screen widths like smart-phones, I desire the two table columns of data on the right to appear below the two on the left but using divs. (Refer to the demo website stated above to see what I mean)
The mark-up for div's would appear much like:
<div id="recipe">
<div class="ingredBlock">
<div class="ingramt">2½</div>
<div class="ingred">cups flour</div>
<div class="ingramt">1 tbsp</div>
<div class="ingred">baking powder</div>
</div>
<div class="ingredBlock">
<div class="ingramt">½ cup</div>
<div class="ingred">butter or shortening</div>
<div class="ingramt">1</div>
<div class="ingred">egg</div>
</div>
<div class="ingredBlock">
<div class="ingramt">1 tsp</div>
<div class="ingred">salt</div>
<div class="merged">some milk</div>
</div>
</div>
Can someone think of a better method for the desired effect? What would the css have to be for aligning divs as required?