Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

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

Posted on 2004-08-02
6
Medium Priority
?
464 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Industry Leaders: 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

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

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

Q&A with Course Creator, Mark Lassoff, on the importance of HTML5 in the career of a modern-day developer.
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
In this tutorial viewers will learn how to position overlapping items using z-index in CSS. They will also learn the restrictions on the z-index property.  Create a new HTML document with an internal stylesheet.: Create a div in CSS and name it Red.…
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…

618 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