By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
449,245 Members | 1,118 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 449,245 IT Pros & Developers. It's quick & easy.

How to make text fit exactly in a table cell.. different results with different editors

P: n/a
Hi all,

to avoid a nervous breakdown I finally decided to seek help :D

I have a table defined with plain color background and in some cells I
show pictures to frame my site.
The problem I have occurs for one special cell.
The background of this cell is as you can see an image. A text should
be displayed on this image.
I don't want the text to be bigger than the picture.

When I save the below code in editor 1 (Coffeecup) and open it in
editor 2 (OpenOffice) the code gets changed and the site looks all
weird because the font-size changes too.

Is there a 'correct' way to define this that every editor I open the
file with would act the same?

How can I make my text fit exactly in a table cell? Is there a way
that I could make it work for both editors?
I'm new to HTML so an example would be really great!

Why does this: ---------------------->
.......
<TR>
<TD WIDTH=15 HEIGHT=69 STYLE="background:
url(Bilder/borderleft2.gif) repeat scroll"></TD>
<TD VALIGN=BOTTOM WIDTH=163 STYLE="background: url(Bilder/anno.gif)
no-repeat scroll">
<P ALIGN=CENTER STYLE="margin-top: 0px; margin-bottom: 4px;
FONT-SIZE=12px"><FONT FACE="Comic Sans MS, cursive">
Blabla </FONT></FONT> <BR> </P>
<P ALIGN=CENTER STYLE="margin-top: 0px; margin-bottom: 4px;
FONT-SIZE=12px"><FONT FACE="Comic Sans MS, cursive">
Blabla <SUP>th</SUP> 2003</FONT></FONT> <BR> </P>
<P ALIGN=CENTER STYLE="margin-top: 3px; FONT-SIZE=12px"><FONT
FACE="Comic Sans MS, cursive">
Blabla </FONT></FONT> <BR></P>

</TD>
<TD WIDTH=19 STYLE="background: url(Bilder/borderright.gif) repeat
scroll"></TD>
</TR>
......
......get changed into this ---------------------------->
......

<TR>
<TD WIDTH=15 HEIGHT=69 STYLE="background:
url(Bilder/borderleft2.gif) repeat scroll"></TD>
<TD WIDTH=163 VALIGN=BOTTOM STYLE="background: url(Bilder/anno.gif)
no-repeat top left scroll">
<P ALIGN=CENTER STYLE="margin-bottom: 3pt"><FONT FACE="Comic Sans
MS, cursive">
Blabla </FONT>
</P>
<P ALIGN=CENTER STYLE="margin-bottom: 3pt"><FONT FACE="Comic Sans
MS, cursive">
Blabla <SUP>th</SUP> 2003</FONT>
</P>
<P ALIGN=CENTER STYLE="margin-top: 2.3pt"><FONT FACE="Comic Sans
MS, cursive">
Blabla </FONT>
</P>
</TD>
<TD WIDTH=19 STYLE="background: url(Bilder/borderright.gif) repeat
scroll"></TD>
</TR>

.......

Thanks
zw
Jul 20 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
"zwylle" <zw****@gmx.net> wrote in message
news:85**************************@posting.google.c om...
When I save the below code in editor 1 (Coffeecup) and open it in
editor 2 (OpenOffice) the code gets changed and the site looks all
weird because the font-size changes too.


Any editor that changes your code for you should be avoided. My advice...
if OpenOffice is changing your code, then don't use it.

Regards,
Peter Foti
Jul 20 '05 #2

P: n/a
"Peter Foti" <pe****@systolicnetworks.com> schrieb im Newsbeitrag
news:vo************@corp.supernews.com...
Any editor that changes your code for you should be avoided. My advice...
if OpenOffice is changing your code, then don't use it.


I agree with that. And I also recommend you to use an editor that makes a
difference between HTML formatting (<font size="..."...>) and CSS (<p
style="font-size:...">). Don't use the <font> tag, and if possible use CSS
with classes instead of the style attribute.

I also recommend you to use an editor that marks up syntax errors. You have
lots of them, for example

<P ALIGN=CENTER STYLE="margin-top: 0px; margin-bottom: 4px;
FONT-SIZE=12px"><FONT FACE="Comic Sans MS, cursive">
Blabla </FONT></FONT> <BR> </P>

(one <font> but 2 </font>s) or

STYLE="margin-top: 3px; FONT-SIZE=12px"

(must be font-size:12px)

I personally work with Dreamweaver as this editor is very convenient for
both layout-view editing and hand coding.

Regarding your original question: I don't think this is possible, but not
because of editor's properties but because of the HTML standards that do not
provide that possibility. If you want the text to match exactly the size of
a table cell you will have to make a gif out of it.

--
Markus
Jul 20 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.