Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Jan 2010
    Posts
    5
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Question How to get Loop output in HTML Table?

    Dear Seniors
    below is the code of Maths table. But i cannot understand how can i get this out into HTML tables in an organized way.
    Your help will be a great favour for me.

    <?php

    for ($i=1; $i<=10; $i++)
    {
    echo 'Tables of '.$i.'<br/>';
    for($j=1; $j<=10;$j++)
    {
    $res=$i*$j;
    echo .$i.'*'.$j.'='.$res.'<br>';
    }
    echo '<br/>';
    }
    ?>

  • #2
    UE Antagonizer Fumigator's Avatar
    Join Date
    Dec 2005
    Location
    Utah, USA, Northwestern hemisphere, Earth, Solar System, Milky Way Galaxy, Alpha Quadrant
    Posts
    7,691
    Thanks
    42
    Thanked 637 Times in 625 Posts
    You are creating HTML code; so just include the <table>, <tr> and <td> tags where you need them. If you are unfamiliar with these tags, visit w3schools.com and learn about how to use table tags.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •