This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: Netscape changes font-size in table


I tried, separately, both your class selector suggestion and your SPAN 
element suggestion.

When I used the class selector code below the text in the table was all the 
same small font size, but not the font that I wanted to use (it looks like 
Times New Roman, but may be another font).  This was the case in both NS and 
IE browsers:

<style>
.mystyle {font-size:11px}
td.mystyle {font-size:11px}
tr td.mystyle {font-size:11px}
table tr td.mystyle {font-size:11px}
div table tr td.mystyle {font-size:11px}
</style>

When I used the class selector code below the text in the table was all the 
same font size, but it was a larger font size than the results displayed for 
the case above despite the fact that the font-size was supposed to be 11px 
for both cases.  The font was also not Verdana (again it looks like Times 
New Roman):

<style>
.mystyle {font-family:Verdana font-size:11px}
td.mystyle {font-family:Verdana font-size:11px}
tr td.mystyle {font-family:Verdana font-size:11px}
table tr td.mystyle {font-family:Verdana font-size:11px}
div table tr td.mystyle {font-family:Verdana font-size:11px}
</style>

I had the same results listed above when I used the SPAN element:

<span style="font-size:11px">

vs.

<span style="font-family:Verdana font-size:11px">

Am I not setting the style correctly to display Verdana font that is 11px in 
both NS 4.27 and IE?

Katie

>From: "McKeever, Marty" <marty.mckeever@bankofamerica.com>
>Reply-To: xsl-list@lists.mulberrytech.com
>To: xsl-list@lists.mulberrytech.com
>CC: kmcnally9@hotmail.com
>Subject: RE: [xsl] Netscape changes font-size in table
>Date: Tue, 27 Nov 2001 07:46:12 -0500
>
>the combination of netscape, table cells, and CSS has always been a pain to
>deal with.  here are my two suggestions, certainly one of them will work 
>for
>you.
>
>First, when using a class selector such as:
><td class="mystyle">foo</td>
>you will want to be very (very!) redundant with the definition:
><style>
>.mystyle {font-size:11px}
>TD.mystyle {font-size:11px}
>TR TD.mystyle {font-size:11px}
>TABLE TR TD.mystyle {font-size:11px}
>DIV TABLE TR TD.mystyle {font-size:11px}
></style>
>this has always worked for me in NS4, once i found the right combinations.
>
>Second, since netscape has so much trouble with TD's, you could do almost
>exactly what you originally planned by using the SPAN element:
><TD><span style="font-size:11px">foo</span></TD>
>changing your original template to output this format would be very simple
>-- and should work fine for what you need to do.  Just dont try to use
>background-color here.
>
>good luck,
>Marty
>
>
>
> > -----Original Message-----
> > From: Katie McNally [mailto:kmcnally9@hotmail.com]
> > Sent: Monday, November 26, 2001 7:37 PM
> > To: xsl-list@lists.mulberrytech.com
> > Subject: Re: [xsl] Netscape changes font-size in table
> >
> >
> > Sorry, forgot to mention that we have to use Netscape 4.72.
> > We know that it
> > looks fine in NS 6.1, but unfortunately this is not the
> > version that is
> > being used.
> >
> >
> > >From: "Thomas B. Passin" <tpassin@mitretek.org>
> > >Reply-To: xsl-list@lists.mulberrytech.com
> > >To: <xsl-list@lists.mulberrytech.com>
> > >Subject: Re: [xsl] Netscape changes font-size in table
> > >Date: Mon, 26 Nov 2001 09:58:12 -0500
> > >
> > >I tried your template, using a little xml file  and
> > stylesheet I made up
> > >around your template.  It displays correctly in both IE,
> > Netscape 6.1,  and
> > >Mozilla 0.9.6.  Either you are doing something odd in your
> > stylesheet or
> > >there's something you haven't mentioned about what you are doing.
> > >
> > >Have you looked at the HTML produced to see if it is what
> > you expected?
> > >
> > >As an aside, I'd suggest applying a class to the td element
> > rather than
> > >using an in-line style everywhere.
> > >
> > >Here's my test xml file:
> > >
> > ><?xml-stylesheet type="text/xsl" href="test.xsl"?>
> > ><root>
> > >  <cell>Aa</cell>
> > >  <cell>Aasfsfsdsdsdfsdf</cell>
> > ></root>
> > >
> > >Here's the stylesheet:
> > >
> > ><xsl:stylesheet version="1.0"
> > >xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>
> > >  <xsl:output method = "html" encoding="Windows-1252" />
> > >
> > >  <xsl:template match="/root">
> > >   <html>
> > >    <head><title>xxx</title></head>
> > >    <body>
> > >     <table><tr>
> > >      <xsl:apply-templates select='cell'/>
> > >     </tr></table>
> > >    </body>
> > >   </html>
> > >  </xsl:template>
> > >
> > >  <xsl:template match='cell'>
> > >   <xsl:element name='td'>
> > >    <xsl:call-template name='ApplyStyle'/>
> > >     <xsl:value-of select='.'/>
> > >   </xsl:element>
> > >  </xsl:template>
> > >
> > ><xsl:template name="ApplyStyle">
> > >     <xsl:attribute name="STYLE">
> > >      font-family:Verdana;
> > >      font-size: 21px;
> > >      color: black;</xsl:attribute>
> > ></xsl:template>
> > >
> > ></xsl:stylesheet>
> > >
> > >Cheers,
> > >
> > >Tom P
> > >
> > >[Katie McNally]
> > >
> > >My XSL stylesheet's main template calls the template below
> > to set the style
> > >of the data displayed in the page's table.  After each <td>
> > tag in the
> > >table, the line <xsl:call-template name="ApplyStyle"/> calls
> > the template
> > >below:
> > >
> > ><xsl:template name="ApplyStyle">
> > >     <xsl:attribute name="STYLE">
> > >         font-family: Verdana;
> > >         font-size: 11px;
> > >         color: black;
> > >     </xsl:attribute>
> > ></xsl:template>
> > >
> > >When displayed in IE, the font is all the same size for all
> > words shown in
> > >the table.  When displayed in the Netscape browser, however,
> > the font-size
> > >changes with the size of the word.  For example, for the
> > column displaying
> > >"Status", the size of the font for the status "New" is much
> > larger than the
> > >font for the status "Approved" in the same column.  The font
> > of all the
> > >values displayed in the "Rate" column is much smaller than
> > the font for the
> > >words displayed in all of the other columns (which have
> > titles that are
> > >longer than the word "Rate").
> > >
> > >Any suggestions on how to set the style/font-size in the
> > stylesheet so that
> > >the table can be displayed correctly in both IE and Netscape?
> > >
> > >
> > >
> > >  XSL-List info and archive:
> > http://www.mulberrytech.com/xsl/xsl-list
> > >
> >
> >
> > _________________________________________________________________
> > Get your FREE download of MSN Explorer at
> > http://explorer.msn.com/intl.asp
> >
> >
> >  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
> >
>
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
>


_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]