473,388 Members | 1,207 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 15604
"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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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.