PDA

View Full Version : how can i insert big font into <td> without changing the <td> size


umen
07-14-2002, 11:01 PM
Hello
i have wired problem im first im trying to innerHTML this:
"<span style='font-size:40;'>x</span>"
like this:
---------------------------------------------------------------------
function Insert()
{
Game.cells[0].innerHTML="<span style='width:40;height:40 '>x</span>"
}
-----------------------------------------------------------------------
now i have this table :

<TABLE WIDTH=270 height=270 BORDER=1 CELLSPACING=1 CELLPADDING=1 id="Game">
<TR>
<TD >&nbsp;</TD>
<TD >&nbsp;</TD>
<TD >&nbsp;</TD>
</TR>
<TR>
<TD >&nbsp;</TD>
<TD >&nbsp;</TD>
<TD >&nbsp;</TD>
</TR>
<TR>
<TD >&nbsp;</TD>
<TD >&nbsp;</TD>
<TD >&nbsp;</TD>
</TR>
</TABLE>



now when i fire the function the <td> gets bigger and the font dont stretch all over the <td> .....
any idea why?

thanks

premshree
07-15-2002, 01:58 PM
The width of the <TD> increases because you did it in the code:
<span style='width:40;height:40 '>x</span>

Since nothing about the font size is mentioned, the font does not stretch over the entire <TD>

Instead of the above code try :
<span style='font-size:15pt '>x</span>

umen
07-15-2002, 02:05 PM
Hello
tnx for the reply but ,again i still gting this margin-top space
when i try to insert the font and the <td> get bigger ..
i like to make simple thing realy just make the font get streatched
all over the < td>
hope i made my self more clear
tnx

premshree
07-16-2002, 07:53 AM
Why don't you specify the width and height in the <TD>


<TABLE BORDER=1 CELLSPACING=1 CELLPADDING=1 id="Game">
<TR>
<TD width="90" height="90"> </TD>
<TD width="90" height="90"> </TD>
<TD width="90" height="90"> </TD>
</TR>
<TR>
<TD width="90" height="90"> </TD>
<TD width="90" height="90"> </TD>
<TD width="90" height="90"> </TD>
</TR>
<TR>
<TD width="90" height="90"> </TD>
<TD width="90" height="90"> </TD>
<TD width="90" height="90"> </TD>
</TR>
</TABLE>

---------------------------------------------------------------------
function Insert()
{
Game.cells[0].innerHTML="<span style='font-size:15pt'>x</span>"
}
-----------------------------------------------------------------------