Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6792477
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T17:58:28+00:00 2026-05-26T17:58:28+00:00

Here is a brain-teaser for the brave. I’ve been at it for days and

  • 0

Here is a brain-teaser for the brave. I’ve been at it for days and just can’t come with the solution.

I wanted to come out with something like this:

enter image description here

Using html, CSS and PHP only.

I got near, but not quite what I expected. Here is the code in PHP and 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>

If someone knows how to represent a binary tree or a dendrogram or comes up with a smarter code please let me know!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T17:58:28+00:00Added an answer on May 26, 2026 at 5:58 pm

    I’ve done something like this, using divs kinda like @HugoDelsing. The way I handled the lines was to divide each pair into 4 vertically-stacked divs:

    1. The first player (border-bottom)
    2. A spacer between 1st and 2nd players (border-right)
    3. The second player (border-bottom and border-right)
    4. A spacer before the next pair (no borders)

    Each of these gets 1/4 the height of the pair*, and the total height of a pair gets doubled as you move to the right. If you don’t have a power of two, fill slots with placeholders to push everything down the right amount.

    *The bottom borders will throw the heights off by 1, so take that into account when styling your rows.

    Other Notes
    The spacer divs may not be necessary, but for me they easily handled the spacing and getting the different columns to line up correctly.

    I used inline styles filled-in by PHP for the heights, so I didn’t have an arbitrary depth limit or calculations hard-coded into CSS.

    Here’s an example.

    EDIT
    OK, here is teh codez:

    <style type="text/css">
        .round{
            float:left;
            width:200px;
        }
        .firstTeam, .secondTeam{
            border-bottom:1px solid #ccc;
            position:relative;
        }
        .firstSpacer, .secondTeam{
            border-right:1px solid #ccc;
        }
        .team{
            position:absolute;
            bottom: 4px;
            left: 8px;
        }
    </style>
    <div class="round">
        <div class="matchup">
            <div class="firstTeam" style="height:29px;"><div class="team">Team One</div></div>
            <div class="firstSpacer" style="height:30px;">&nbsp;</div>
            <div class="secondTeam" style="height:29px;"><div class="team">Team Two</div></div>
            <div class="secondSpacer" style="height:30px;">&nbsp;</div>
        </div>
        <div class="matchup">
            <div class="firstTeam" style="height:29px;"><div class="team">Team Three</div></div>
            <div class="firstSpacer" style="height:30px;">&nbsp;</div>
            <div class="secondTeam" style="height:29px;"><div class="team">Team Four</div></div>
            <div class="secondSpacer" style="height:30px;">&nbsp;</div>
        </div>
        <div class="matchup">
            <div class="firstTeam" style="height:29px;"><div class="team">Team Five</div></div>
            <div class="firstSpacer" style="height:30px;">&nbsp;</div>
            <div class="secondTeam" style="height:29px;"><div class="team">Team Six</div></div>
            <div class="secondSpacer" style="height:30px;">&nbsp;</div>
        </div>
        <div class="matchup">
            <div class="firstTeam" style="height:29px;"><div class="team">Team Seven</div></div>
            <div class="firstSpacer" style="height:30px;">&nbsp;</div>
            <div class="secondTeam" style="height:29px;"><div class="team">Team Eight</div></div>
            <div class="secondSpacer" style="height:30px;">&nbsp;</div>
        </div>
    </div>
    <div class="round">
        <div class="matchup">
            <div class="firstTeam" style="height:59px;"><div class="team">Team One</div></div>
            <div class="firstSpacer" style="height:60px;">&nbsp;</div>
            <div class="secondTeam" style="height:59px;"><div class="team">Team Three</div></div>
            <div class="secondSpacer" style="height:60px;">&nbsp;</div>
        </div>
        <div class="matchup">
            <div class="firstTeam" style="height:59px;"><div class="team">Team Five</div></div>
            <div class="firstSpacer" style="height:60px;">&nbsp;</div>
            <div class="secondTeam" style="height:59px;"><div class="team">Team Eight</div></div>
            <div class="secondSpacer" style="height:60px;">&nbsp;</div>
        </div>
    </div>
    <div class="round">
        <div class="matchup">
            <div class="firstTeam" style="height:119px;">&nbsp;</div>
            <div class="firstSpacer" style="height:120px;">&nbsp;</div>
            <div class="secondTeam" style="height:119px;">&nbsp;</div>
            <div class="secondSpacer" style="height:120px;">&nbsp;</div>
        </div>
    </div>
    <div class="round">
        <div class="matchup">
            <div class="firstTeam" style="height:239px;">&nbsp;</div>
        </div>
    </div>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here's a brain teaser that's been on my mind for a few days. We
I'm seriously having a brain fart here, but I can't figure out why this
I've been racking my brain trying to figure this out. Here is the scenario.
My brain aint functioning atm.. Can you pls help me out here: Got a
after wracking my brain for days, I just hope someone can point me to
time for another brain teaser of something I guess is quite rare. Is there
Sorry folks, I must be brain-dead or something but I can't get the styling
I have been wracking my brain trying to figure this out. For the first
I'm having a bit of a brain fart here, and hoping someone can help
I have a problem here and it seems that my brain has just left

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.