Page 1 of 1

Font Size (In table)

Posted: Thu Jan 21, 2010 9:34 am
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??

Re: Font Size (In table)

Posted: Thu Jan 21, 2010 9:43 am
by Grizzzzzzzzzz
google-ing for "html table font size" was a pretty good bet

http://www.chami.com/tips/Internet/052098I.html

Re: Font Size (In table)

Posted: Thu Jan 21, 2010 9:46 am
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" >

Re: Font Size (In table)

Posted: Thu Jan 21, 2010 9:47 am
by Jay87
but the table is on PHP!

Re: Font Size (In table)

Posted: Thu Jan 21, 2010 9:56 am
by pickle
The browser doesn't know that. The browser sees a regular HTML file.

Re: Font Size (In table)

Posted: Thu Jan 21, 2010 9:56 am
by Grizzzzzzzzzz
Jay87 wrote:but the table is on PHP!
..

all you're doing in PHP is echoing HTML anyway

Re: Font Size (In table)

Posted: Fri Jan 22, 2010 4:43 am
by Jay87
I tried:

Code: Select all

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

Re: Font Size (In table)

Posted: Fri Jan 22, 2010 4:53 am
by aravona

Code: Select all

<tr  style= "font-size:20px;">
hello
</tr>
<tr  style= "font-size:100px;">
world
need to confirm the size format.

Re: Font Size (In table)

Posted: Fri Jan 22, 2010 7:22 am
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.

Re: Font Size (In table)

Posted: Fri Jan 22, 2010 7:30 am
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.

Re: Font Size (In table)

Posted: Mon Jan 25, 2010 5:42 am
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: