473,657 Members | 2,571 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

<TD>, CSS and Firefox

I have having two problems with the <TD>, CSS, Firefox combination. I
would greatly appreciate any information on fixing them.

Firstly, none of the padding or margin values I apply to a <TD> have
any visual effect. Everything is fine in IE.

Secondly, I am trying to set the background-image of a particular <TD>
to an image, and that's not working either. Applying it to the parent
<TR> works, as does applying it to other <TD>s in the document. The
image will display if inserted with an img tag. There are no classes
applied to any of the cell's parents.

<table width="100%" border="0" cellpadding="0" cellspacing="0" >
<tr>
<td width="220"><im g src="images/header_small.gi f" width="219"
height="60"></td>
<td background="ima ges/cloudsandangles .gif"
class="cloudsan dangles"></td>
</tr>
<tr>
<td colspan="2" bgcolor="#1573F F"
background="../Site/images/bargrad.gif"></td>
</tr>
</table>

Again, everything is fine in IE (even without the <td background>)
Jul 20 '05 #1
6 12592
DU
matt cook napsal(a):
I have having two problems with the <TD>, CSS, Firefox combination. I
would greatly appreciate any information on fixing them.

Firstly, none of the padding or margin values I apply to a <TD> have
any visual effect. Everything is fine in IE.

You have not provided an example, an url on this. So, it's kinda
difficult to understand, to guess what you mean, to guess what your code
actually is, what you expect and what you get.

What kind of visual effect would you actually expect to see with margin
applied to a table cell? A margin applied to a table cell makes no sense
in my mind. Border-spacing as a CSS2 table property or cellspacing as an
HTML 4.01 attribute is different.
Secondly, I am trying to set the background-image of a particular <TD>
to an image, and that's not working either. Applying it to the parent
<TR> works, as does applying it to other <TD>s in the document. The
image will display if inserted with an img tag. There are no classes
applied to any of the cell's parents.

<table width="100%" border="0" cellpadding="0" cellspacing="0" >
<tr>
<td width="220"><im g src="images/header_small.gi f" width="219"
height="60">
Your code is not entirely consequent. You have <table width="200%", then
<td width="220" and then an <img width="219"
You can just drop width constraints because they are unneeded here.
</td> <td background="ima ges/cloudsandangles .gif"
class="cloudsan dangles"></td>
..cloudandangle s is not defined in the code you provided here.
background attribute is not defined anywhere in HTML 4.01. I assumed uou
probably meant to use
style="backgrou nd-image: url('images/cloudsandangles .gif');
Finally, your table cell is empty: no text node.
</tr>
<tr>
<td colspan="2" bgcolor="#1573F F"
bgcolor is deprecated.
background="../Site/images/bargrad.gif"></td>
background is invalid markup code.
</tr>
Better is
style="backgrou nd: #1573FF url('../Site/images/bargrad.gif');"
Again, you have an empty cell; so you should not see the background
image nor color since the text node is empty.
</table>

Again, everything is fine in IE (even without the <td background>)


DU
--
The site said to use Internet Explorer 5 or better... so I switched to
Netscape 7.2 :)
Jul 20 '05 #2
DU <dr*******@hotN OSPAMmail.com> wrote in message news:<2q******* ******@uni-berlin.de>...
matt cook napsal(a):
I have having two problems with the <TD>, CSS, Firefox combination. I
would greatly appreciate any information on fixing them.

Firstly, none of the padding or margin values I apply to a <TD> have
any visual effect. Everything is fine in IE.


You have not provided an example, an url on this. So, it's kinda
difficult to understand, to guess what you mean, to guess what your code
actually is, what you expect and what you get.


Simply, I have a TD tag (or a TR tag) with a class attached to it like
this:
<tr valign="top" bgcolor="#62C0F F" class="10pad">.

10pad looks like this:
..10pad {
padding:10px;
}

I expected Firefox to act like IE does and pad the cells it's applied
to. I mentioned margins because a fix I found for a similar issue uses
them.
As for the background issue, I fixed that by setting the TR background
instead of the TD. This works in Firfox, although it works differently
to IE and needs a line of browser specific code to work on both.
I know I should be using DIVs instead of tables BTW :-)
Jul 20 '05 #3
matt cook wrote:
DU <dr*******@hotN OSPAMmail.com> wrote in message news:<2q******* ******@uni-berlin.de>...
You have not provided an example, an url on this. So, it's kinda
difficult to understand, to guess what you mean, to guess what your code
actually is, what you expect and what you get.


Simply, I have a TD tag (or a TR tag) with a class attached to it like
this:
<tr valign="top" bgcolor="#62C0F F" class="10pad">.

10pad looks like this:
.10pad {
padding:10px;
}

I expected Firefox to act like IE does and pad the cells it's applied
to. I mentioned margins because a fix I found for a similar issue uses
them.


Still no URL. I have working padding on a <td> here:

http://tranchant.plus.com/tmp/td
As for the background issue, I fixed that by setting the TR background
instead of the TD. This works in Firfox, although it works differently
to IE and needs a line of browser specific code to work on both.
The above URL also shows a working td background image via CSS. Both
features work fine in Firefox and IE.

POST A URL AND WE CAN HELP!!! Snippets of out-of-context code are no good.
I know I should be using DIVs instead of tables BTW :-)


Not necessarily <div>s: you can style and position other elements. But
if you know you should be not using tables, and tables are causing you
problems, stop using them.

--
Mark.
http://tranchant.plus.com/
Jul 20 '05 #4
matt cook wrote:

<tr valign="top" bgcolor="#62C0F F" class="10pad">.

I expected Firefox to act like IE does


Maybe Firefox is following the specs where IE does not (big surprise),
is ignoring the invalid class name, thus not applying those styles.

<URL:http://www.w3.org/TR/CSS2/syndata.html#q4 >
"In CSS2, identifiers (including element names, classes, and IDs in
selectors) [...] cannot start with a hyphen or a digit."

--
Reply email address is a bottomless spam bucket.
Please reply to the group so everyone can share.
Jul 20 '05 #5
kchayka <us****@c-net.us> wrote in message news:<2q******* ******@uni-berlin.de>...
matt cook wrote:

<tr valign="top" bgcolor="#62C0F F" class="10pad">.

I expected Firefox to act like IE does


Maybe Firefox is following the specs where IE does not (big surprise),
is ignoring the invalid class name, thus not applying those styles.

<URL:http://www.w3.org/TR/CSS2/syndata.html#q4 >
"In CSS2, identifiers (including element names, classes, and IDs in
selectors) [...] cannot start with a hyphen or a digit."


And indeed, that is the case. Thank you!
Jul 20 '05 #6
matt cook wrote:
kchayka <us****@c-net.us> wrote in message news:<2q******* ******@uni-berlin.de>...
matt cook wrote:
>
> <tr valign="top" bgcolor="#62C0F F" class="10pad">.


<URL:http://www.w3.org/TR/CSS2/syndata.html#q4 >
"In CSS2, identifiers (including element names, classes, and IDs in
selectors) [...] cannot start with a hyphen or a digit."


And indeed, that is the case. Thank you!


FYI, in the future, you can find errors like this yourself if you
validate your code.
<URL:http://validator.w3.or g/>
<URL:http://jigsaw.w3.org/css-validator/>
<URL:http://www.htmlhelp.co m/tools/>

--
Reply email address is a bottomless spam bucket.
Please reply to the group so everyone can share.
Jul 20 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
8623
by: Matt Adams | last post by:
I want to move the following <PRE> defintion to a css file: <TABLE><TR><TD><PRE>sample text</PRE></TD> <TD> not predefined font</TD></TR></TABLE> should be <TABLE><TR><TD class=aaa>sample text</TD> <TD> not predefined font</TD></TR></TABLE>
0
2062
by: Dean Speir | last post by:
Hoping that someone here can see the glitch I'm experiencing. I build a site for an organization in which a <TD> which recurs on most of the pages displays exactly as intended in IE, Netscape and Firefox. It is seen here: http://www.lipsa.net/, and the external style sheet is at http://www.lipsa.net/pbr.css. Note how the dark green TD "sidebar" on the right of the screen flushes all the way to the right, and up against both the top and...
2
11206
by: js | last post by:
I have a table rendered with XSLT. The first column has a radio button controls for user to make a selection for a particular row. All the values in the remaining columns are all concated with a &#xA0; (blank). I need to retieve the text in each cell of that row if the radio button on that row is clicked. Each <TD> has a numeric ID so that I can use it with document.getElementById().innerText method. I use Javascript to assign some...
2
5760
by: bissatch | last post by:
Hi, I am trying to use JavaScript to write a table column on a web page. The code is as follows: <html> <head> <script> function displaycount() {
5
2933
by: mahesr | last post by:
I want to match some particular text between <tr>and </tr> or <td>and </td>.... in PHP. like below............ <table><tr> CATEGORY: <td><font face="Verdana" size="1" color="#A000A0"> Wedding Accessories
1
2430
by: munnaj | last post by:
hai all, Help me with a style code for firefox. Below is the code which is working fine in IE. But does not work well in firefox. I have also tried with another class for firefox that too not working. Do help me..... <td width='75%' align='left' valign='top' style='width:700px;word-wrap:break-word'><p align='justify'>$Description</p></td>"
7
2782
by: Xiaoyan | last post by:
Hi,everyone: I have a problem now. I can't get the information between the <tr><td> and </td></tr>. for example: I use this regular expression can't get it, I don't know why. $test=~/<tr><td>(.*)<\/td><\/td>(.*)<\/td><\/tr>/ms; <tr><td>station</td> <td>station number/identification, see chart above: <br> B = GoMoos buoy B location<br> S = New Scantum at the southern edge Jefferys Ledge</td></tr>.
2
3014
by: markszlazak | last post by:
I'm a relatively slow response of table cells changing their background color with mouseover/our in IE6 (Win 2K) but the response is fine (fast) in Firefox. Why? The code is below. Sorry about the length. <html> <head> <title>Rapid Blocking Interface</title> <style> .calendar {
3
2605
by: yawnmoth | last post by:
http://www.frostjedi.com/terra/scripts/demo/td-position.html In Internet Explorer, the "hello, world!" text is on top on the red box is on the bottom. In Firefox, the "hello, world!" text is on top and the red box is in the middle. Internet Explorer's rendition is the preferred rendition. Any idea as to how to make Firefox's rendition look more like Internet Explorer's? Thanks!
0
8392
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
8305
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
8823
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8730
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...
0
8605
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7321
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
6163
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
4301
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2726
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.