Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Applying a style from two different .css files.

Status
Not open for further replies.

pomuz

Technical User
Mar 23, 2007
8
CA
Hello,

I am working with file 1: base.css which has this declared in it:

.noWrap {
white-space: nowrap;
}

And file 2: institution.css with this in it:

.cell-grey-lt { background: #DDDDDD; }

From my xhtml file, I am trying to apply both of these in the following line of code:

<td valign="bottom" class="noWrap cell-grey-lt alignRight">5 971</td>

However, only the second style, cell-grey-lt, is applying itself. The numbers, against my wish ARE wrapping. Can someone help? Am I calling the styles incorrectly?

Thank you very much!
 
Try not calling that class name noWrap, since nowrap can be used in HTML.

Call it something like nowrapClass.



[monkey][snake] <.
 
I tried your suggestion....it didn't work :(
 
Hmm, without looking in depth on this cause I don't know some of you other declarations, I can think of 2 things that may not be right.

1. Is it possible you aren't importing the external CSS file correctly?

2. Do you have a specific width declared on your td elements that is too small to contain the contents w/o going to a new line. (I did test this, and even with nowrap, the numbers will wrap if the width is declared too small).



[monkey][snake] <.
 
I've checked #1, and yes, they are linked correctly.

Here is the table code:
<code>

<table border="0" cellspacing="0" cellpadding="3" class="table-atip">
<tr>
<td>Re&ccedil;ues pendant la p&eacute;riode du rapport</td>
<td class="alignRight" valign="bottom">5 515</td>
</tr>
<tr>
<td>En suspens depuis la p&eacute;riode ant&eacute;rieure (re&ccedil;ues
en 2002&#8211;2003
et toujours en cours de traitement au d&eacute;but de 2003&#8211;2004)</td>
<td class="alignRight" valign="bottom">456*</td>
</tr>
<tr>
<td class="cell-grey-lt">Total&nbsp;:</td>


************
<td valign="bottom" class="cell-grey-lt alignRight noWrap">5 971</td>
************
</tr>
<tr>
<td>Trait&eacute;es pendant la p&eacute;riode du rapport</td>
<td class="alignRight" valign="bottom">4 870</td>
</tr>
<tr>
<td>Report&eacute;es &agrave; l&#8217;exercice 2004&#8211;2005 (re&ccedil;ues
en 2003&#8211;2004 et toujours
en cours de traitement au d&eacute;but de 2004&#8211;2005)</td>
<td class="alignRight" valign="bottom">1 101</td>
</tr>
</table>

</code>

The stars are just there to isolate the row that is still wrapping.

Can you spot anything wrong? I can't :(

Thank you
 
I've checked #1, and yes, they are linked correctly.

Here is the table code:
Code:
<table border="0" cellspacing="0" cellpadding="3" class="table-atip">
        <tr> 
          <td>Re&ccedil;ues pendant la p&eacute;riode du rapport</td>
          <td class="alignRight" valign="bottom">5 515</td>
        </tr>
        <tr> 
          <td>En suspens depuis la p&eacute;riode ant&eacute;rieure (re&ccedil;ues
            en 2002&#8211;2003 
et toujours en cours de traitement au d&eacute;but de 2003&#8211;2004)</td>
          <td class="alignRight" valign="bottom">456*</td>
        </tr>
        <tr> 
          <td class="cell-grey-lt">Total&nbsp;:</td>
       

[b] <td valign="bottom" class="cell-grey-lt alignRight noWrap">5 971</td>
[/b]        </tr>
        <tr> 
          <td>Trait&eacute;es pendant la p&eacute;riode du rapport</td>
          <td class="alignRight" valign="bottom">4 870</td>
        </tr>
        <tr> 
          <td>Report&eacute;es &agrave; l&#8217;exercice 2004&#8211;2005 (re&ccedil;ues
            en 2003&#8211;2004 et toujours  
en cours de traitement au d&eacute;but de 2004&#8211;2005)</td>
          <td class="alignRight" valign="bottom">1 101</td>
        </tr>
      </table>


Can you spot anything wrong? I can't :(

Thank you
 
I can't see anything wrong. Do you think you could come up with a mock page showing this problem? That way it would be easier to debug.
 
Hello,

I finally figured it out. It's the strangest thing, but if i put a space (&nbsp) within the longest number : 5&nbsp515, it works.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top