【发布时间】:2011-11-25 09:11:39
【问题描述】:
这是勇敢者的脑筋急转弯。我已经用了好几天了,只是无法提供解决方案。
我想拿出这样的东西:
仅使用 html、CSS 和 PHP。
我接近了,但并不完全符合我的预期。 Here is the code in PHP 和 here is the output。
<table border="0">
<thead>
<tr>
<th>Cientoveintiochavos</th>
<th>Seseintaicuatravos</th>
<th>Treintaidosavos</th>
<th>Dieciseisavos</th>
<th>Octavos</th>
<th>Cuartos</th>
<th>Semifinales</th>
<th>Final</th>
</tr>
</thead>
<tbody>
<?php for($i=0;$i<256;$i++): ?>
<tr>
<?php for($n=0,$c=2;$n<8;$n++,$c*=2): ?>
<?php
/*
if(false){//$i == 0) {
$rwspn = $c/2+1;
$iter = 0;
} else {
$rwspn = $c;
$iter = $c;//-$c/2+1;
}
*/
$class = ($i%($c*2))?'par':'impar winner';
if($i%$c==0):?>
<td rowspan="<?=$c;?>" class="<?=$class;?>"><span><?php echo genRandomString();?></span></td>
<?php endif; ?>
<?php endfor; ?>
</tr>
<?php endfor; ?>
</tbody>
</table>
如果有人知道如何表示二叉树或树状图或提出更智能的代码,请告诉我!
【问题讨论】:
标签: php html-table binary-tree data-representation