1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

add code for font size under php echo code

Discussion in 'PHP' started by newphpcoder, Nov 11, 2010.

  1. newphpcoder

    newphpcoder New Member

    Joined:
    Sep 24, 2010
    Messages:
    101
    Likes Received:
    0
    Trophy Points:
    0
    Occupation:
    Web Programmer
    Location:
    Philippines
    Good day!
    I have a pure php code, so my table was in echo and I want to change the font and font-size of text in table header but when I put thid code:
    PHP:
    echo "<font size="18" face='Arial'>";
    echo 
    "<table>";
    and 
    at the lower part i close it
    echo "</table>";
    echo 
    "</font>";
    It only take effect in the text outside the table. and when I try to put it on the <table> It doesn't take effect.
    Thank you in advance
     
  2. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,287
    Likes Received:
    364
    Trophy Points:
    83
    First you have to understand the basic of HTML here.

    If you have 2 tags with needed property defined the one inner will have the effect but if they don't have any properties defined the one outside's effect will be applied.

    Simple example is

    <A href="#">Some Link</A> - Let us say this is blue link. Now you want the link to be red.
    you can do it in 2 ways lets say
    <A href="#"><span classs="red">Some Link</span></A>
    <span classs="red"><A href="#">Some Link</A></span>

    Both will not have the same effect.

    First one will be red but not the second one.

    Similarly in your case as well.

    Best way is to style your Table but if you have many tables you can style with CSS
     

Share This Page