CSS/PHP: How to make left and right float div the same height regardless of much information is in them? -



CSS/PHP: How to make left and right float div the same height regardless of much information is in them? -

how create left , right float div same height regardless of much info in them? number of divs created dynamically alternating left , right info in them.

<div class="columns"> <?php $cemp = true; foreach ( $req_user_emp $id => $name ) { echo "<div ".(($cemp = !$cemp)?" class=\"column_right\"":" class=\"column_left\"").">"; echo "<h3>".$req_user_emp[$id]['position']."</h3>"; echo "<h4>".$req_user_emp[$id]['company_name']."</h4>"; echo $req_user_emp[$id]['description']; echo "<div class=\"column_footer\">".$req_user_emp[$id]['start_date']." → ".$req_user_emp[$id]['end_date']."</div></div>"; } ?> </div>

and css

.columns { width: auto; margin-left: -10px; } .columns:after { content: "if can see this, broke columns!"; width: auto; display: block; text-indent: -10000000px; height: 1px; clear: both; margin-bottom: -20px; } .row_level { display:table-cell; } .column_left { width: 288px; float: left; background: #e1e1e1; padding: 20px; border: 1px solid #d1d1d1; margin-bottom: 20px; } .column_right { width: 288px; float: right; padding: 20px; background: #e1e1e1; border: 1px solid #d1d1d1; margin-bottom: 20px; }

now have info in mysql want arrange 2 columns. code works, if info in columns not equal the columns not arranging correctly. have thought on how prepare this? thinking utilize if in foreach function:

if ( $i % 2 == 0 ) { enter_my_code_here; }

and utilize the .row_level container .left , .right far know doesn't work in ie (and have no way test now).

thank you

there's no simple way create floated elements 100% height. best approach either height: 100% or top: 0; bottom: x; if height known. otherwise, you're looking @ using visual trick.

php css

Comments

Popular posts from this blog

How do I check if an insert was successful with MySQLdb in Python? -

delphi - blogger via idHTTP : error 400 bad request -

postgresql - ERROR: operator is not unique: unknown + unknown -