473,594 Members | 2,812 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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="backgrou nd:
url(Bilder/borderleft2.gif ) repeat scroll"></TD>
<TD VALIGN=BOTTOM WIDTH=163 STYLE="backgrou nd: url(Bilder/anno.gif)
no-repeat scroll">
<P ALIGN=CENTER STYLE="margin-top: 0px; margin-bottom: 4px;
FONT-SIZE=12px"><FON T FACE="Comic Sans MS, cursive">
Blabla </FONT></FONT> <BR> </P>
<P ALIGN=CENTER STYLE="margin-top: 0px; margin-bottom: 4px;
FONT-SIZE=12px"><FON T FACE="Comic Sans MS, cursive">
Blabla <SUP>th</SUP> 2003</FONT></FONT> <BR> </P>
<P ALIGN=CENTER STYLE="margin-top: 3px; FONT-SIZE=12px"><FON T
FACE="Comic Sans MS, cursive">
Blabla </FONT></FONT> <BR></P>

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

<TR>
<TD WIDTH=15 HEIGHT=69 STYLE="backgrou nd:
url(Bilder/borderleft2.gif ) repeat scroll"></TD>
<TD WIDTH=163 VALIGN=BOTTOM STYLE="backgrou nd: 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="backgrou nd: url(Bilder/borderright.gif ) repeat
scroll"></TD>
</TR>

.......

Thanks
zw
Jul 20 '05 #1
2 15620
"zwylle" <zw****@gmx.net > wrote in message
news:85******** *************** ***@posting.goo gle.com...
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****@systoli cnetworks.com> schrieb im Newsbeitrag
news:vo******** ****@corp.super news.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"><FON T 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
2482
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 change its text contents from a link elsewhere in the page? I have a rought idea that I'll need something like 'id' in my <td> tags but while I have a greater understanding of server-side programming langauges like PHP, javascript is still very new...
82
10651
by: Peter Diedrich | last post by:
The site design is pretty simple: ============================================ | Head | ============================================ | | | | | | | | | left | center | right | | | | | | | | |
3
10878
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 fixed nor percentage) for this table cell? Sizing the element to 100% width and height does not work, as the parent element's width and height are not specified. And yet, in this case at least, the width and height of the table cell are very...
6
1882
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 http://murorum.demon.co.uk/engarde/poules.html. The V/M column should be centred, while the Indicator and HS columns should be right aligned. Since I was defining column widths within a <colgroup> I thought it would be cleaner to define the alignment of...
9
2715
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 color to indicate to the user which cells are clickable). (I think I could achieve this by adding an image (with attached hyperlink) to each clickable cell but since this is a large table (7 x 30) I think this might be a slow solution). ...
6
4858
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 the html page controls the form fields that are required. It doesn't function like it's supposed to and I can leave all the fields blank and it still submits the form. Also I can't get it to transfer the file in the upload section. The file name...
10
2166
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 I am doing is quering the db for all the headers for a certain group and then going through them to find all the parts of each post. I only want ones that are complete. Meaning all segments for that one file posted are there. using System;
1
2059
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 query language, which forces me to do the join manually via arrays. Right now, I'm having trouble getting these query results (which are in
1
1402
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 to go into a different input field. I have the code below to help visualise what I am trying to do. I think what I want is similar to a calendar where you can select the date you want and it appears in an input field - this I can do, but can't...
0
7946
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
7877
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8374
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8009
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
6661
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
5739
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
3867
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
3903
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1482
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.