Change text size of data from MySQL database

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • Rob (SA)
    Lieutenant Colonel

    • Nov 2006
    • 586

    Change text size of data from MySQL database

    Hi Folks,

    Please help me with this - I need to change the text sizes and colour but do not know where to insert this information.

    You can see what is currently happening at www.gnjgf.co.za/entryformmysql.php

    !------------------------------------------------------------------->
    <! THIS SECTION FETCHES THE INFORMATION FROM THE TABLE >
    <!------------------------------------------------------------------->

    <?php
    while($row=mysql_fetch_array($result)){
    echo "</td><td>";
    echo $row['name'];
    echo "</td><td>";
    echo $row['surname'];
    echo "</td><td>";
    echo $row['my_handicap_is'];
    echo "</td><td>";
    echo $row['i_wish_to_play'];
    echo "</td></tr>";
    }
    echo "</table>";
    ?>
    Kind Regards
    Rob
    www.gnjgf.co.za
    www.oryan-projects.com
  • Watdaflip
    Major General

    • Sep 2005
    • 2116

    #2
    Re: Change text size of data from MySQL database

    It depends on how your going to change the formatting, if you are going to use css I would do something like

    <?php
    while($row=mysql_fetch_array($result)){
    echo '<tr><td class="name">';
    echo $row['name'];
    echo '</td><td class="surname">';
    echo $row['surname'];
    echo '</td><td class="handicap">';
    echo $row['my_handicap_is'];
    echo '</td><td class="wish_to_play">';
    echo $row['i_wish_to_play'];
    echo '</td></tr>';
    }
    echo '</table>';
    ?>

    Also note the blue text. You had a closing tag for a column instead of the opening tag for the row.

    For the actual formatting you would then add this between your head tags

    <style type="text/css">
    .name {
    color: #0000FF;
    font-size: 12px;
    }

    .surname {
    color: #0000FF;
    font-size: 12px;
    }

    .handicap {
    color: #0000FF;
    font-size: 12px;
    }

    .wish_to_play {
    color: #0000FF;
    font-size: 12px;
    }
    </style>

    Register/Login Script
    Do you use a Password Protected Directory? Need a way to allow users to make their own account, try my .htaccess Login Script

    Comment

    • Rob (SA)
      Lieutenant Colonel

      • Nov 2006
      • 586

      #3
      Re: Change text size of data from MySQL database

      Hi,

      Thanks for the reply but unfortunatly no impact to making the changes.
      Kind Regards
      Rob
      www.gnjgf.co.za
      www.oryan-projects.com

      Comment

      • Rob (SA)
        Lieutenant Colonel

        • Nov 2006
        • 586

        #4
        Re: Change text size of data from MySQL database

        Hi Me again,

        Sorry it was finger problems on my side.

        Looking much better - thank you.

        Next port of call is to set the width of the last column in order that the text does not wrap or seems to wrap onto the next line.
        Kind Regards
        Rob
        www.gnjgf.co.za
        www.oryan-projects.com

        Comment

        • Watdaflip
          Major General

          • Sep 2005
          • 2116

          #5
          Re: Change text size of data from MySQL database

          In your column header you can just change the <td> tags to look like

          <td width="400">{column_title}</td>

          Changing 400 to the number of pixels you want the width to be

          Register/Login Script
          Do you use a Password Protected Directory? Need a way to allow users to make their own account, try my .htaccess Login Script

          Comment

          • Rob (SA)
            Lieutenant Colonel

            • Nov 2006
            • 586

            #6
            Re: Change text size of data from MySQL database

            Thanks for the prompt reply.

            I do not know where my column headers are.

            I have a section in that looks like this:

            <!------------------------------------------------------------------->
            <! THIS SECTION CHANGES WHAT THE TABLE LOOKS LIKE >
            <!------------------------------------------------------------------->

            <table border=3 width="35%" cellspacing=0 style="background-color:#F0F8FF;" >
            <!------------------------------------------------------------------->
            <! THIS SECTION CHANGES THE MAIN HEADING >
            <!------------------------------------------------------------------->

            <caption><b><font style="font-size:12px" color="#00008B" face="Arial">
            TOURNAMENT ENTRIES</font><b><caption>

            <!------------------------------------------------------------------->
            <!--------THIS SECTION CHANGES THE ACTUAL COLUMN HEADINGS------------>
            <!------------------------------------------------------------------->

            <tr>
            <th><b><font style="font-size:11px" color="#00008B" face="Arial">NAME</font></b></th>
            <th><b><font style="font-size:11px" color="#00008B" face="Arial">SURNAME</font></b></th>
            <th><b><font style="font-size:11px" color="#00008B" face="Arial">HANDICAP</font></b></th>
            <th><b><font style="font-size:11px" color="#00008B" face="Arial">TOURNAMENT</font></b></th>
            </tr>
            Kind Regards
            Rob
            www.gnjgf.co.za
            www.oryan-projects.com

            Comment

            • Rob (SA)
              Lieutenant Colonel

              • Nov 2006
              • 586

              #7
              Re: Change text size of data from MySQL database

              Hi,

              Progressing slowly but in the right direction.

              The value seen below as 35% only needs to be ammended to a higher value say 85% and this widens the table.

              It seems so simple when one knows how.

              Thanks for your support
              Kind Regards
              Rob
              www.gnjgf.co.za
              www.oryan-projects.com

              Comment

              • Rob (SA)
                Lieutenant Colonel

                • Nov 2006
                • 586

                #8
                Re: Change text size of data from MySQL database

                Hi,

                New question on same page.
                1. Can I use a script to sort the last column?
                2. Can I dump this page to an excel file in using a button?
                Kind Regards
                Rob
                www.gnjgf.co.za
                www.oryan-projects.com

                Comment

                • Watdaflip
                  Major General

                  • Sep 2005
                  • 2116

                  #9
                  Re: Change text size of data from MySQL database

                  <th> tags can use the width attribute as well.

                  The 35&#37; table width makes it take only 35% of the available width (this would be the page width unless the table is wrappped in another element which has a width set).

                  You can set the 35% to something larger, or remove the width="35%" from the <table> tag and only define the width in the the <th> tags

                  You can use php to sort the results on the page request, or javascript to do sorting with the loaded data.

                  To dump the table's data into an excel file by exporting it in phpmyadmin

                  Register/Login Script
                  Do you use a Password Protected Directory? Need a way to allow users to make their own account, try my .htaccess Login Script

                  Comment

                  • Rob (SA)
                    Lieutenant Colonel

                    • Nov 2006
                    • 586

                    #10
                    Re: Change text size of data from MySQL database

                    Hi,

                    So then if I am not misunderstood I can insert the <td>. . . . </td) btween the <th> marks and I should get the result I am looking for regarding my column widths ?

                    My thought behind the sorting is to allow the table to sort into tournaments at a set time and date.

                    This will mean that a date will be specified on the entry form as well as the time and the entry form page will close at that time and the sort will happen similtaneously.

                    If there are 5 tournaments it will do the same.

                    The dump is possible via phpadmin and the sorting can also be done there - I am just looking at automating this process and that way there is less traffic by admin people to the backend of this process.

                    Thanks again for the help
                    Kind Regards
                    Rob
                    www.gnjgf.co.za
                    www.oryan-projects.com

                    Comment

                    • Rob (SA)
                      Lieutenant Colonel

                      • Nov 2006
                      • 586

                      #11
                      Re: Change text size of data from MySQL database

                      Hi,

                      Well the progress is till good.

                      Using Phpadmin I have managed to get the page to sort as I wanted and the overall look is promising.

                      Is there anyone who can help me with the other remaining issues
                      Kind Regards
                      Rob
                      www.gnjgf.co.za
                      www.oryan-projects.com

                      Comment

                      • Watdaflip
                        Major General

                        • Sep 2005
                        • 2116

                        #12
                        Re: Change text size of data from MySQL database

                        You wouldn't added a <td></td> tag inside a <th></th>, I was just saying the inner properties such as <td width="300"> also work in a <th> tag, so you just need to make it

                        <th width="#width#">

                        changing #width# to either a number in pixels or percent

                        Register/Login Script
                        Do you use a Password Protected Directory? Need a way to allow users to make their own account, try my .htaccess Login Script

                        Comment

                        • Rob (SA)
                          Lieutenant Colonel

                          • Nov 2006
                          • 586

                          #13
                          Re: Change text size of data from MySQL database

                          Hi,

                          Please let us know what this is?
                          Kind Regards
                          Rob
                          www.gnjgf.co.za
                          www.oryan-projects.com

                          Comment

                          Working...
                          X