dezkit Posted July 13, 2008 Share Posted July 13, 2008 i want to align every field in a table. see image: i want so that Dynamic gaming, section 13, and everyother field to be aligned, as do i want the 16-0, 14-16 and etc. here is my code: <table cellspacing="0" cellpadding="2"> <? $i = 0; while($r = mysql_fetch_array($q)) { $i += 1; $winner = split("-",$r['score']); if($winner[0] > $winner[1]) { $status = "<td class=\"win\">Won</td>"; } else if($winner[0] < $winner[1]) { $status = "<td class=\"loss\">Loss</td>"; } else { $status = "<td class=\"tie\">Tie</td>"; } ?> <tr class="row<?=($i&1)?>"> <td>[<?=$r['team1']?>] <?=$r['team2']?></td> <td class="score"><?=$r['score']?></td> <?=$status?> </tr> <?if($r['info'] != "") { ?> <tr class="row<?=($i&1)?>"> <td colspan="3" class="comments"><i> HLTV Demo: <a href="demos/<?=$r['info']?>">download</a> </i></td> </tr> <? } } ?></table><? } else { echo "We haven't played any matches yet!"; } ?> Quote Link to comment Share on other sites More sharing options...
Third_Degree Posted July 13, 2008 Share Posted July 13, 2008 I'm confused, you want it like the image or not like the image? Quote Link to comment Share on other sites More sharing options...
dezkit Posted July 13, 2008 Author Share Posted July 13, 2008 not like the image Quote Link to comment Share on other sites More sharing options...
Third_Degree Posted July 13, 2008 Share Posted July 13, 2008 can you post your css? Quote Link to comment Share on other sites More sharing options...
JasonLewis Posted July 13, 2008 Share Posted July 13, 2008 Try this: <table cellspacing="0" cellpadding="2"> <? $i = 0; while($r = mysql_fetch_array($q)) { $i += 1; $winner = split("-",$r['score']); if($winner[0] > $winner[1]) { $status = "<td class=\"win\">Won</td>"; } else if($winner[0] < $winner[1]) { $status = "<td class=\"loss\">Loss</td>"; } else { $status = "<td class=\"tie\">Tie</td>"; } ?> <tr class="row<?=($i&1)?>"> <td>[<?=$r['team1']?>]</td> <td><?=$r['team2']?></td> <td class="score"><?=$winner[0]?> -</td> <td class="score"><?=$winner[1]?></td> <?=$status?> </tr> <?if($r['info'] != "") { ?> <tr class="row<?=($i&1)?>"> <td colspan="3" class="comments"><i> HLTV Demo: <a href="demos/<?=$r['info']?>">download</a> </i></td> </tr> <? } } ?></table><? } else { echo "We haven't played any matches yet!"; } ?> Of course you'll need to format it a bit more.... Quote Link to comment Share on other sites More sharing options...
dezkit Posted July 13, 2008 Author Share Posted July 13, 2008 nevermind i got it Quote Link to comment Share on other sites More sharing options...
Third_Degree Posted July 13, 2008 Share Posted July 13, 2008 nevermind i got it ok then Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.