Sunday 9 June 2013

  • How to create default gridview in php ?

    Hello friends,today we will know about how to create tabular format or we can say grid view format in php like other programming languages.

    As we know,representing data in tabular format is very necessary when each and every column defines different attributes.So,to create gridview in php we must have to type some code based on HTML.

    So,friends lets see how to create default grid view in  php.




    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Untitled Document</title>
    </head>

    <body>
    <table border="1" align="center">
    <tr>
    <td>
    Surname
    </td>
    <td>
    Name
    </td>
    <td>
    Age
    </td>
    </tr>
    <?php
    for($i=0;$i<5;$i++)
    {
    ?>
    <tr>
    <td>
    abc
    </td>
    <td>
    abc
    </td>
    <td>
    18
    </td>
    </tr>
    <?php
    }
    ?>
    </table>
    </body>
    </html>


    The output will be like as below.


    If you like this post then give your reviews in comment and share with your friends.



  • 0 comments:

    Post a Comment

    Copyright @ 2013 Programming Languages.