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 8 of 8
  1. #1
    Registered User
    Join Date
    Jan 2003
    Location
    CT
    Posts
    91
    Thanks
    0
    Thanked 0 Times in 0 Posts

    changing text color help plz

    how do i change the text color in the following section of my script:

    PHP Code:
    echo "<h2>Vote Results:</h2>";
        echo 
    "<TABLE CELLSPACING=2 CELLPADDING=0 BORDER=0>";
        echo 
    "<tr><th>Vote</th><th>Percentage</th><th>Total</th></tr>";

        while (list(
    $key$val) = each(    $ANSWER)) {
            
    $percent =  $file_array[$key] * 100 $total;
            
    $percent_int floor($percent);
            
    $percent_float number_format($percent1);
            
    $tp += $percent_float;
            echo 
    "<tr><td> $ANSWER[$key] </td><td><img height=9 src=\"$IMG_DIR_URL/vote_left.gif\"><img height=9 width=\"$percent_int\" src=\"$IMG_DIR_URL/vote_middle.gif\"><img height=9 src=\"$IMG_DIR_URL/vote_right.gif\"> $percent_float % </td><td>$file_array[$key]</td></tr>";
        }

        echo 
    "</TABLE><br>"
    the script can been seen at www.warpcell.com/php_poll.php i want the text to be white and in font "Comic sans MS" how would i do that?

  • #2
    Regular Coder
    Join Date
    Jun 2002
    Location
    Sheffield, UK
    Posts
    552
    Thanks
    0
    Thanked 0 Times in 0 Posts
    try using CSS styles, you can use them to format all of the headers and all of the table cells' fonts and colours which should be exactly what you need:
    Code:
    <style>
    th, td, h2 {
    font: "Comic Sans MS";
    color: white
    }
    </style>
    "To be successful in IT you don't need to know everything - just where to find it in under 30 seconds"

    (Me Me Me Me Me Me Me Me Me)

  • #3
    New Coder
    Join Date
    Sep 2002
    Location
    UK
    Posts
    65
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Yeah learning CSS would be a better way of doing this. I'd personally always use an external style sheet, thus separating your code out better

  • #4
    Registered User
    Join Date
    Feb 2003
    Posts
    43
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hey

    I don't see what this has to do with PHP?

    Jesh

  • #5
    New Coder
    Join Date
    Sep 2002
    Location
    UK
    Posts
    65
    Thanks
    1
    Thanked 0 Times in 0 Posts
    IT doesn't but using a CSS style will make changing colours much easier

  • #6
    Registered User
    Join Date
    Jan 2003
    Location
    CT
    Posts
    91
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Originally posted by Jesh
    Hey

    I don't see what this has to do with PHP?

    Jesh
    how do you think it has nothing about php? i had a question about changing something in a php script. where would you like me to post it, in the html forum?

  • #7
    Super Moderator
    Join Date
    May 2002
    Location
    Perth Australia
    Posts
    4,040
    Thanks
    10
    Thanked 92 Times in 90 Posts
    "how do you think it has nothing about php? i had a question about changing something in a php script. where would you like me to post it, in the html forum?"

    well basically yes

    it is a css/html question and would have been better suited in another forum but since asked and answered I will leave it here.
    resistance is...

    MVC is the current buzz in web application architectures. It comes from event-driven desktop application design and doesn't fit into web application design very well. But luckily nobody really knows what MVC means, so we can call our presentation layer separation mechanism MVC and move on. (Rasmus Lerdorf)

  • #8
    Registered User
    Join Date
    Jan 2003
    Location
    CT
    Posts
    91
    Thanks
    0
    Thanked 0 Times in 0 Posts
    obviously i didnt know the solution wasnt php that is WHY I POSTED IT IN THE PHP FORUM


  •  

    Posting Permissions

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