我正在尝试使用PHP创建锦标赛表。 This is the HTML code sample.
<table>
<thead>
<tr>
<th>1</th>
<th>2</th>
<th>final</th>
<th>winner</th>
</tr>
</thead>
<tbody>
<tr>
<td class="team">team1</td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td></td>
<td class="team">team1</td>
<td></td>
<td></td>
</tr>
<tr>
<td class="team">team2</td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
<td class="team">team4</td>
<td></td>
</tr>
<tr>
<td class="team">team3</td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td></td>
<td class="team">team4</td>
<td></td>
<td></td>
</tr>
<tr>
<td class="team">team4</td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
<td class="team">team4 vinner</td>
</tr>
<tr>
<td class="team">team5</td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td></td>
<td class="team">team6</td>
<td></td>
<td></td>
</tr>
<tr>
<td class="team">team6</td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
<td class="team">team8</td>
<td></td>
</tr>
<tr>
<td class="team">team7</td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td></td>
<td class="team">team8</td>
<td></td>
<td></td>
</tr>
<tr>
<td class="team">team8</td>
<td></td>
<td></td>
<td></td>
</tr>
</tbody>
</table>
我尝试使用for
循环创建该表,但这种方法效果不佳。
也许你可以给一些提示?我没有想法。
答案 0 :(得分:0)
您正在使用的消除系统称为“单一消除”(有时是“头对头”),您希望实现的输出通常称为“括号”。
看看:
Generate a single elimination tournament
并且:PHP Single Elimination Tournament Table