[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

CSS: why is Mozilla bleeding borders with border-collapse in my code?

Posted on 2004-08-02
6
Medium Priority
?
467 Views
Last Modified: 2010-08-05
Hi, here's some code that works great in IE, but not Mozilla.

border collapse seems to cause the problem but I need border-collapse (although it may not be apparent why in this example... but I do need it in IE. In mozilla I don't need it but I can't figure out a way to set border-collapse only for IE except via DHTML which I don't want to use)

Any ideas?


<STYLE TYPE="text/css">
<!--
TABLE.sheet {border-collapse: collapse}
TD.f0 { border-left: solid 2pt black; border-right: solid 2pt black; border-top: solid 2pt black; border-bottom: solid 2pt black; font-family: "Arial"; font-size: 10pt; background-color: #ffff00; vertical-align: top;}
TD.f1 { font-family: "Arial"; font-size: 10pt; vertical-align: bottom;}
TD.f2 { border-left: solid 2pt #3366ff; border-right: solid 2pt #3366ff; border-top: solid 2pt #3366ff; border-bottom: solid 2pt #3366ff; font-family: "Arial"; font-size: 10pt; font-weight: bold; font-style: italic; background-color: #99ccff; vertical-align: top;}

-->
</STYLE>
<TABLE class=sheet>
  <TR class=sheet height=18 style='height:13.5pt'>
    <TH class=row> 1</TH>
    <TD width=64 style='width:48pt' class=sheet>&nbsp;</TD>
    <TD width=64 style='width:48pt' class=sheet>&nbsp;</TD>
    <TD width=64 style='width:48pt' class=sheet>&nbsp;</TD>
    <TD width=64 style='width:48pt' class=sheet>&nbsp;</TD>
    <TD width=64 style='width:48pt' class=sheet>&nbsp;</TD>
  <TR class=sheet height=18 style='height:13.5pt'>
    <TH class=row> 2</TH>
    <TD width=64 style='width:48pt' class=sheet>&nbsp;</TD>
    <TD class=f0 ROWSPAN=2 COLSPAN=2> Merged Cells</TD>
    <TD width=64 style='width:48pt' class=sheet>&nbsp;</TD>
    <TD width=64 style='width:48pt' class=f1 align=right> 1</TD>
  <TR class=sheet height=18 style='height:13.5pt'>
    <TH class=row> 3</TH>
    <TD width=64 style='width:48pt' class=sheet>&nbsp;</TD>
    <TD width=64 style='width:48pt' class=sheet>&nbsp;</TD>
    <TD width=64 style='width:48pt' class=sheet>&nbsp;</TD>
  <TR class=sheet height=19 style='height:14.25pt'>
    <TH class=row> 4</TH>
    <TD width=64 style='width:48pt' class=sheet>&nbsp;</TD>
    <TD width=64 style='width:48pt' class=sheet>&nbsp;</TD>
    <TD width=64 style='width:48pt' class=sheet>&nbsp;</TD>
    <TD width=64 style='width:48pt' class=sheet>&nbsp;</TD>
    <TD width=64 style='width:48pt' class=sheet>&nbsp;</TD>
  <TR class=sheet height=18 style='height:13.5pt'>
    <TH class=row> 5</TH>
    <TD width=64 style='width:48pt' class=sheet>&nbsp;</TD>
    <TD class=f2 ROWSPAN=2 COLSPAN=2>Merged Cells</TD>
    <TD width=64 style='width:48pt' class=sheet>&nbsp;</TD>
    <TD width=64 style='width:48pt' class=sheet>&nbsp;</TD>
  <TR class=sheet height=18 style='height:13.5pt'>
    <TH class=row> 6</TH>
    <TD width=64 style='width:48pt' class=sheet>&nbsp;</TD>
    <TD width=64 style='width:48pt' class=sheet>&nbsp;</TD>
    <TD width=64 style='width:48pt' class=sheet>&nbsp;</TD>
</TABLE>
0
Comment
Question by:ycomp
6 Comments
 
LVL 36

Accepted Solution

by:
Zyloch earned 1000 total points
ID: 11697179
Sure, set it like this:

TABLE.sheet {_border-collapse: collapse}

This would be IE-only
0
 
LVL 14

Assisted Solution

by:dfu23
dfu23 earned 1000 total points
ID: 11697184
<!--[if gte ie 5.5000]>
<style type="text/css">
TABLE.sheet {border-collapse: collapse}
</style>
<![endif]-->
0
 

Author Comment

by:ycomp
ID: 11697318
wow guys thanks.. I wish I'd known about these things the other day. Would have saved me much time.
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:ycomp
ID: 11697322
Zyloch, what is the logic behind the underscore ?
0
 
LVL 31

Expert Comment

by:seanpowell
ID: 11697345
http://wellstyled.com/css-underscore-hack.html

I wish I was sure you needed to do it this way though :-)

And watch your table code there...
0
 

Author Comment

by:ycomp
ID: 11697481
thanks sean.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When it comes to write a Context Sensitive Help (an online help that is obtained from a specific point in state of software to provide help with that state) ,  first we need to make the file that contains all topics, which are given exclusive IDs. …
Originally, this post was published on Monitis Blog, you can check it here . Websites are getting bigger and more complicated by the day. Video, images and custom fonts are all great for showcasing your product or service. But the price to pay in…
In this tutorial viewers will learn how to code links for mobile sites that, once clicked, send a call or text to a specified number. For a telephone link (once clicked, calls a number), begin with a normal "<a href=" link tag. For the href, specify…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.
Suggested Courses

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question