SearchSearch   

GridLines or borders around cells disappear in Firefox

 
   Webmaster Forums (Home) -> CSS RSS
Next:  CSS layout problem in 1E6 and Safari  
Author Message
shah.jigar

External


Since: Aug 08, 2007
Posts: 3



(Msg. 1) Posted: Wed Aug 08, 2007 11:05 pm
Post subject: GridLines or borders around cells disappear in Firefox
Archived from groups: comp>infosystems>www>authoring>stylesheets (more info?)

Hi all,
I have the following code for which I need borders around all the
cells irrespective of their background color or even if they are
empty. There needs to be grids or borders. Somehow this just doesn't
work in Firefox 2.0. Any suggestions would be helpful. Thanks. I was
trying to create static headers thats why the extra code.

<style>
table{
empty-cells: show;
}
..container
{
border: 1pt solid black;
height: 150px;
width: 100%;
overflow: auto;
}
..Freezing
{
position:relative ;
top:expression(this.offsetParent.scrollTop-2);
z-index: 10;
background-color: white;
}
</style>
<div class="containerIE2" id="containerIE2">
<table rules="all" border =1 width="80%" style="border-
collapse:collapse;">
<tr>
<th>Col1></th><th>Col1></th><th>Col1></th><th>Col1></th></tr>
<tbody class="container">
<tr><td style="color: White; background-color: White;"> </td>
<td style="background-color: Lime;">vow</td>
<td>3</td></tr><tr><td bgcolor="Lime">nothing again</td><td></
td><td>3</td></tr>
<tr><td style="background-color: White;"></td>
<td style="color: Lime; background-color: Lime;"></td><td>3</td>
</tr><tr><td style="background-color: White;"></td>
<td style="color: Lime; background-color: Lime;"></td><td>3</td>
</tr><tr>
<td style="background-color: White;"></td>
<td style="color: Lime; background-color: Lime;"></td><td>3</td>
</tr><tr><td style="background-color: White;"></td>
<td style="color: Lime; background-color: Lime;"></td><td>3</td>
</tr><tr><td style="background-color: White;"></td>
<td style="color: Lime; background-color: Lime;"></td><td>3</td>
</tr>
</tbody>
</table>
</div>
Back to top
dorayme

External


Since: Feb 19, 2006
Posts: 3160



(Msg. 2) Posted: Thu Aug 09, 2007 9:21 am
Post subject: Re: GridLines or borders around cells disappear in Firefox
Archived from groups: per prev. post (more info?)

In article
<1186614347.342551.266030.TakeThisOut@g4g2000hsf.googlegroups.com>,
shah.jigar.TakeThisOut@gmail.com wrote:

> Hi all,
> I have the following code for which I need borders around all the
> cells irrespective of their background color or even if they are
> empty. There needs to be grids or borders. Somehow this just doesn't
> work in Firefox 2.0.

....snip some mangled code

If you want borders around the table and or td, you can have them:

table {border: 1px solid #000;}

and/or

td {border: 1px solid #000;}

--
dorayme
Back to top
Jukka K. Korpela

External


Since: Feb 13, 2004
Posts: 3794



(Msg. 3) Posted: Thu Aug 09, 2007 1:56 pm
Post subject: Re: GridLines or borders around cells disappear in Firefox
Archived from groups: per prev. post (more info?)

Scripsit shah.jigar RemoveThis @gmail.com:

> I have the following code

In future, please post a URL, not a copy of code. Hang around for a week or
so, and you'll see explanations for this.

> for which I need borders around all the
> cells irrespective of their background color or even if they are
> empty. There needs to be grids or borders.

Then use <td> </td> for the empty cells. If however those cells need to
be smaller than what a poor lonesome no-break space needs, use a
single-pixel transparent image. More info:
http://www.cs.tut.fi/~jkorpela/html/emptycells.html

> Somehow this just doesn't
> work in Firefox 2.0.

I'd be more worried about IE, which ignores the empty-cells property.

I can't tell what really happens on Firefox here. Even setting
td { border: solid 1px red!important }
doesn't seem to help, for the empty cells. Neither does it help to use
 . But when I remove the CSS code that makes the tbody scrollable, the
borders are there.

I'd say that the idea of creating static headings by making the tbody
scrollable, though feasible in theory, just doesn't work in practice. It
does not work at all on IE, so in terms of WWW authoring, it's not very
useful. You would need to use two tables, one for the headings and one
(wrapped inside a div to please IE) for the data cells and made scrollable.
Then the question is how to make their column widths match becomes crucial,
and the answer is unfortunately that you need to set the widths explicitly.

> Any suggestions would be helpful. Thanks. I was
> trying to create static headers thats why the extra code.

I won't work that way on IE. By the way, on IE 7, your all rows have 150px
height. Apparently IE recognizes width: 150px for the tbody element but
incorrectly applies it to all _rows_.

Besides, you have headers (<th>) for four columns but only three columns of
data.

--
Jukka K. Korpela ("Yucca")
http://www.cs.tut.fi/~jkorpela/
Back to top
shah.jigar

External


Since: Aug 08, 2007
Posts: 3



(Msg. 4) Posted: Thu Aug 09, 2007 3:11 pm
Post subject: Detailed CODE: Re: GridLines or borders around cells disappear in Firefox
Archived from groups: per prev. post (more info?)

I am sorry that I didn't put the full code out there. ASP.net spits
out the HTML and what you see here is nothing but a stripped down
version to simply illustrate the problem. Here's the full version that
gets IE to work, but fails in Firefox. If I can have Firefox show the
grids, I am all done. Thanks in advance to anyone who is willing to
give it a try. The borders simply disappear. The idea of two tables
doesn't work as the widths need to be set explicitly and the two
tables need to align perfectly too..like the column headings...Is
there any other cross browser simpler solution for making the headers
static...a tleast on IE and Firefox?



<html>
<style id="instyle" type="text/css">


..containerIE
{
border: 1px solid black;
height: 150px;
overflow: auto;
}

table{
empty-cells: show;
}

..container
{
border: 1pt solid black;
height: 150px;
width: 80%
overflow: auto;
overflow-x: hidden;
}


..Freezing
{
position:relative ;
top:expression(this.offsetParent.scrollTop-2);
z-index: 10;
background-color: white;
}

</style>
<script>
function modifyHTML()
{

if (navigator.appVersion.indexOf("MSIE")!=-1){

}
else{ //its not IE so hide the containerIE tag
var tab= document.getElementById("instyle");
str= tab.innerHTML;
str=str.replace("containerIE", "containerIE2"); //Simply Supress IE
behaviour on non-IE browsers
tab.innerHTML=str;
}
</script>
<body onLoad="modifyHTML();">
<div class="containerIE" id="containerIE">
<table rules="all" border =1 width="80%" style="border-
collapse:collapse;">
<tr class="Freezing">
<th>Col1</th>
<th>Col2</th>
<th>Col3</th>

</tr>
<tbody class="container">
<tr>
<td style="color: White; background-color: White;"> </td>
<td style="background-color: Lime;">vow</td>
<td>3</td></tr>
<tr><td bgcolor="Lime">nothing again</td><td></td><td>Whatever</td></
tr>
<tr>
<td style="background-color: White;"></td>
<td style="color: Lime; background-color: Lime;"></td><td>3</td>
</tr>
<tr>
<td style="background-color: White;"></td>
<td style="color: Lime; background-color: Lime;"></td><td>Jack</td>
</tr>
<tr>
<td style="background-color: White;"></td>
<td style="color: Lime; background-color: Lime;"></td><td>3</td>
</tr>
<tr>
<td style="background-color: White;"></td>
<td style="color: Lime; background-color: Lime;"></td><td>Hello</td>
</tr>
<tr>
<td style="background-color: White;"></td>
<td style="color: Lime; background-color: Lime;"></td><td>3</td>
</tr>

</tbody>
</table>
</div>
</body>
</html>
Back to top
Jukka K. Korpela

External


Since: Feb 13, 2004
Posts: 3794



(Msg. 5) Posted: Fri Aug 10, 2007 12:02 am
Post subject: Re: Detailed CODE: Re: GridLines or borders around cells disappear in Firefox
Archived from groups: per prev. post (more info?)

Scripsit shah.jigar.TakeThisOut@gmail.com:

> I am sorry that I didn't put the full code out there.

Which part of my advice "In future, please post a URL, not a copy of code.
Hang around for a week or so, and you'll see explanations for this." did you
fail to understand?

> <td style="color: White; background-color: White;"> </td>
> <td style="background-color: Lime;">vow</td>

Sorry, my doctor has forbidden me from reading such a mess. Learn how to use
classes, mm'kay? Maybe you could start by forgetting that you ever heard of
style="..." attributes.

--
Jukka K. Korpela ("Yucca")
http://www.cs.tut.fi/~jkorpela/
Back to top
shah.jigar

External


Since: Aug 08, 2007
Posts: 3



(Msg. 6) Posted: Fri Aug 10, 2007 7:44 am
Post subject: Re: Detailed CODE: Re: GridLines or borders around cells disappear in Firefox
Archived from groups: per prev. post (more info?)

so you have no solution that can do a fixed header that works on IE
and firefox and one that doesn't involve use of two tables? This guy's
close http://blogs.crankygoblin.com/blogs/geoff.appleby/archive/2005/02/02/49529.aspx
but his solution doesnt' have grids.
Back to top
Display posts from previous:   
       Webmaster Forums (Home) -> CSS
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum