+ Reply to Thread
Results 1 to 13 of 13

Thread: Change text size of data from MySQL database
      
   

  1. #1
    Rob (SA)'s Avatar
    Rob (SA) is offline Lieutenant Colonel
    Join Date
    Nov 2006
    Location
    Centurion, South Africa
    Posts
    580

    Question 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>";
    ?>

  2. #2
    Watdaflip's Avatar
    Watdaflip is offline Major General
    Join Date
    Sep 2005
    Location
    Cincinnati, Ohio
    Posts
    2,119

    Default 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

  3. #3
    Rob (SA)'s Avatar
    Rob (SA) is offline Lieutenant Colonel
    Join Date
    Nov 2006
    Location
    Centurion, South Africa
    Posts
    580

    Default Re: Change text size of data from MySQL database

    Hi,

    Thanks for the reply but unfortunatly no impact to making the changes.

  4. #4
    Rob (SA)'s Avatar
    Rob (SA) is offline Lieutenant Colonel
    Join Date
    Nov 2006
    Location
    Centurion, South Africa
    Posts
    580

    Question 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.

  5. #5
    Watdaflip's Avatar
    Watdaflip is offline Major General
    Join Date
    Sep 2005
    Location
    Cincinnati, Ohio
    Posts
    2,119

    Default 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

  6. #6
    Rob (SA)'s Avatar
    Rob (SA) is offline Lieutenant Colonel
    Join Date
    Nov 2006
    Location
    Centurion, South Africa
    Posts
    580

    Default 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>

  7. #7
    Rob (SA)'s Avatar
    Rob (SA) is offline Lieutenant Colonel
    Join Date
    Nov 2006
    Location
    Centurion, South Africa
    Posts
    580

    Thumbs up 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

  8. #8
    Rob (SA)'s Avatar
    Rob (SA) is offline Lieutenant Colonel
    Join Date
    Nov 2006
    Location
    Centurion, South Africa
    Posts
    580

    Question 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?

  9. #9
    Watdaflip's Avatar
    Watdaflip is offline Major General
    Join Date
    Sep 2005
    Location
    Cincinnati, Ohio
    Posts
    2,119

    Default 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

  10. #10
    Rob (SA)'s Avatar
    Rob (SA) is offline Lieutenant Colonel
    Join Date
    Nov 2006
    Location
    Centurion, South Africa
    Posts
    580

    Question 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

  11. #11
    Rob (SA)'s Avatar
    Rob (SA) is offline Lieutenant Colonel
    Join Date
    Nov 2006
    Location
    Centurion, South Africa
    Posts
    580

    Question 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

  12. #12
    Watdaflip's Avatar
    Watdaflip is offline Major General
    Join Date
    Sep 2005
    Location
    Cincinnati, Ohio
    Posts
    2,119

    Default 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

  13. #13
    Rob (SA)'s Avatar
    Rob (SA) is offline Lieutenant Colonel
    Join Date
    Nov 2006
    Location
    Centurion, South Africa
    Posts
    580

    Question Re: Change text size of data from MySQL database

    Hi,

    Please let us know what this is?

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49