Font Size (In table)

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Jay87
Forum Commoner
Posts: 61
Joined: Thu Jan 07, 2010 5:22 am

Font Size (In table)

Post by Jay87 »

I have the current code:

Code: Select all

echo "<tr style=\"color:red;\" onclick=\"document.location='viewcall.php?id="[color=#FF0000]etc.[/color]
how can i add a style to change the font size??
User avatar
Grizzzzzzzzzz
Forum Contributor
Posts: 125
Joined: Wed Sep 02, 2009 8:51 am

Re: Font Size (In table)

Post by Grizzzzzzzzzz »

google-ing for "html table font size" was a pretty good bet

http://www.chami.com/tips/Internet/052098I.html
aravona
Forum Contributor
Posts: 347
Joined: Sat Jun 13, 2009 3:59 pm
Location: England

Re: Font Size (In table)

Post by aravona »

based on your previous code:

<tr style= \"font: Arial;\" >

but you would have an easier time using a CSS file, and using

<tr class= "whatever" >
Jay87
Forum Commoner
Posts: 61
Joined: Thu Jan 07, 2010 5:22 am

Re: Font Size (In table)

Post by Jay87 »

but the table is on PHP!
User avatar
pickle
Briney Mod
Posts: 6445
Joined: Mon Jan 19, 2004 6:11 pm
Location: 53.01N x 112.48W
Contact:

Re: Font Size (In table)

Post by pickle »

The browser doesn't know that. The browser sees a regular HTML file.
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
User avatar
Grizzzzzzzzzz
Forum Contributor
Posts: 125
Joined: Wed Sep 02, 2009 8:51 am

Re: Font Size (In table)

Post by Grizzzzzzzzzz »

Jay87 wrote:but the table is on PHP!
..

all you're doing in PHP is echoing HTML anyway
Jay87
Forum Commoner
Posts: 61
Joined: Thu Jan 07, 2010 5:22 am

Re: Font Size (In table)

Post by Jay87 »

I tried:

Code: Select all

<tr  style= \"font-size:20;\"
but it doesn't work, any advice?
aravona
Forum Contributor
Posts: 347
Joined: Sat Jun 13, 2009 3:59 pm
Location: England

Re: Font Size (In table)

Post by aravona »

Code: Select all

<tr  style= "font-size:20px;">
hello
</tr>
<tr  style= "font-size:100px;">
world
need to confirm the size format.
User avatar
Grizzzzzzzzzz
Forum Contributor
Posts: 125
Joined: Wed Sep 02, 2009 8:51 am

Re: Font Size (In table)

Post by Grizzzzzzzzzz »

Jay87 wrote:I tried:

Code: Select all

<tr  style= \"font-size:20;\"
but it doesn't work, any advice?

Code: Select all

 
<?php
    echo "<html>
    <table border=1>
    <tr style=\"font-size:10;\"><td> test 1 </td></tr>
    <tr style=\"font-size:25;\"><td> test 2 </td></tr>
    <tr style=\"font-size:66;\"><td> test 3 </td></tr>
    <tr style=\"font-size:40;\"><td> test 4 </td></tr>
    </table>
    </html>";
?>
 
if that still doesn't work then you've done something fundamental wrong.
aravona
Forum Contributor
Posts: 347
Joined: Sat Jun 13, 2009 3:59 pm
Location: England

Re: Font Size (In table)

Post by aravona »

Grizzzzzzzzzz wrote:

Code: Select all

 
<?php
    echo "<html>
    <table border=1>
    <tr style=\"font-size:10;\"><td> test 1 </td></tr>
    <tr style=\"font-size:25;\"><td> test 2 </td></tr>
    <tr style=\"font-size:66;\"><td> test 3 </td></tr>
    <tr style=\"font-size:40;\"><td> test 4 </td></tr>
    </table>
    </html>";
?>
 
That table had standard sizes, all same for me.

Code: Select all

 
<?php
    echo "<html>
    <table border=1>
    <tr style=\"font-size:10px;\"><td> test 1 </td></tr>
    <tr style=\"font-size:25px;\"><td> test 2 </td></tr>
    <tr style=\"font-size:66px;\"><td> test 3 </td></tr>
    <tr style=\"font-size:40px;\"><td> test 4 </td></tr>
    </table>
    </html>";
?>
 
With 'px' works fine tho.
Jay87
Forum Commoner
Posts: 61
Joined: Thu Jan 07, 2010 5:22 am

Re: Font Size (In table)

Post by Jay87 »

aravona wrote:
That table had standard sizes, all same for me.

Code: Select all

 
<?php
    echo "<html>
    <table border=1>
    <tr style=\"font-size:10px;\"><td> test 1 </td></tr>
    <tr style=\"font-size:25px;\"><td> test 2 </td></tr>
    <tr style=\"font-size:66px;\"><td> test 3 </td></tr>
    <tr style=\"font-size:40px;\"><td> test 4 </td></tr>
    </table>
    </html>";
?>
 
With 'px' works fine tho.
when i add that to my page it works fine but when i add <tr style=\"font-size:40px;\"> to the table:

Code: Select all

echo "<tr style=\"font-size:20px;\" onclick=\"document.location='viewcall.php?id=" . $item['id'] . "&pfx=" . $item['id_prefix']; if($HTTP_SERVER_VARS['QUERY_STRING']){ echo "&";} echo $HTTP_SERVER_VARS['QUERY_STRING'] . "';\">


There is more code to that table but i thought i'd just show abit of it....

The font stays the same size...! V frustrating... as the line above it i have:

Code: Select all

echo "<tr style=\"color:red;\" onclick=\" .......etc.....
else
ant that changes that row to red!

:banghead:
Post Reply