473,388 Members | 1,068 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,388 software developers and data experts.

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

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
2 15606
"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
"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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

14
by: Reply Via Newsgroup | last post by:
Folks, Say I have a table, ten columns, ten rows - Each with a word in it. I want to change the values of some/all of the cells in the table via a hyperlink. How do I reference each cell and...
82
by: Peter Diedrich | last post by:
The site design is pretty simple: ============================================ | Head | ============================================ | | ...
3
by: Thomas Mlynarczyk | last post by:
Hello, How can I make an <a> element (containing text only, styled to be a box with a border) as big as the table cell in which it resides, *without* having specified any width/height (neither...
6
by: Colin Walls | last post by:
I am writing some HTML and CSS that will eventually be produced by a program for running fencing tournaments. Everything is fine apart from column alignment for numbers. Have a look at...
9
by: Paul W | last post by:
I'm using a Table webcontrol to display a 'grid' to the user. Various cells should be 'clickable' by the user (to run javascript). How can I make this happen? (currently I use the background cell...
6
by: scottyman | last post by:
I can't make this script work properly. I've gone as far as I can with it and the rest is out of my ability. I can do some html editing but I'm lost in the Java world. The script at the bottom of...
10
by: Extremest | last post by:
I know there are ways to make this a lot faster. Any newsreader does this in seconds. I don't know how they do it and I am very new to c#. If anyone knows a faster way please let me know. All...
1
by: ferraro.joseph | last post by:
Hi, I'm querying Salesforce.com via their AJAX toolkit and outputting query results into a table. Currently, their toolkit does not possess the ability to do table joins via their structured...
1
by: anonymousstar | last post by:
Hi Everyone, I am creating a search facility that holds titles and SKU numbers. When the results appear in a 2 column table I would like the title to go into an input (readonly) field and the SKU...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.