CF - Format data from SQL table with CSS

I am trying to display data from a SQL table - varchar(max) format with my css tag and then the query like so

<p class="cssname"><cfoutput query="qryName">#disclaimer#</cfoutput></p>

It displays but it does not take the css format.  Is this not possible?

Thanks
JohnMac328Asked:
Who is Participating?
 
_agx_Commented:
Simplest? Wrap in a different element so it *will* inherit properties like font-size, such as a <div>

<div class="smallDisclaimer">
<p>Unaudited Portfolio Holdings Disclosure for period ending 02/28/2011</p>...
</div>
0
 
cfEngineersCommented:
can you paste the view-source to see what actually got rendered?

I suspect that the disclaimer variable has its own formatting?
0
 
JohnMac328Author Commented:
That won't work with the CMS we are using.  It is just displaying the data from the table with no CSS formating, I am guessing it does not work with a query like I am trying.
0
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
cfEngineersCommented:
try putting static text in there to see if your css is actually modifying the text
0
 
JohnMac328Author Commented:
Yes it does - that is what I am trying to get away from and have the data in a table instead of on the pages.
0
 
cfEngineersCommented:
right i understand that, we just testing to see if the css is working


FOR TESTING ONLY
 replace

<p class="cssname"><cfoutput query="qryName">#disclaimer#</cfoutput></p>

with

<textarea><cfoutput query="qryName">#disclaimer#</cfoutput></textarea>

this will output any html that might be with that variable from your cms.

another thing to try is

<p class="cssname" style="font-size:24px;"><cfoutput query="qryName">#disclaimer#</cfoutput></p>

see if an inline style will modify the text
0
 
_agx_Commented:
It displays but it does not take the css format.

What is the formatting it's supposed to "take"? Does your #disclaimer# content contain html/css? If so, those styles may be overriding the the "cssname" styles.  
0
 
JohnMac328Author Commented:
Hi agx -

Ok - if I display this

<p class="cssname">Paragraph of text</p>  I get the correct format from the css.  The data in the table is just <p> and no other formatting.  The CMS must be preventing the data to display with the css that I want.
0
 
cfEngineersCommented:
Strip the html from disclaimer text
0
 
cfEngineersCommented:
Strip the html from disclaimer text
0
 
JohnMac328Author Commented:
I tried it with and without.  I was just curious if I was missing something.
0
 
_agx_Commented:
The data in the table is just <p> and no other formatting.  

Do you mean the value of #disclaimer# is literally:  "<p>some text inside a paragraph</p>"?

0
 
_agx_Commented:
Also- on the page that *doesn't* work, do a view source and post the actual html generated. Or if it's a public page, can you post a link?
0
 
JohnMac328Author Commented:
Yes - I was hoping there would be a way to display the data with css formatting if I placed the output query inside the css class decloration
0
 
JohnMac328Author Commented:
This is what the view source is displaying

<p class="smallDisclaimer"><p>Unaudited Portfolio Holdings Disclosure for period ending 02/28/2011</p><p>Dollar-Weighted Average Portfolio Maturity (WAM) - 12 Days</p><p>Dollar-Weighted Average Portfolio Maturity (determined without reference to exceptions for interest rate readjustments) (WAL) - 38 Days</p><p>Form N-MFP is publically available on the <a href="http://www.sec.gov/cgi-bin/browse-edgar?action=getcompany&CIK=0000101507&type=N-MFP&dateb=&count=20&scd=filings"> SEC website</a>.</p>
0
 
_agx_Commented:
It seems like the <p> tags *inside* the content aren't inheriting the CSS styles from the parent tag ie <p class="smallDisclaimer">.  Exactly what CSS style(s) are you're trying to apply?

0
 
JohnMac328Author Commented:
Makes it the very small font size for the disclaimer.  I guess I can manually enter them but that might make more work which defeats the purpose of adding the info to the table.  How do we handle resolving the question?
0
 
JohnMac328Author Commented:
That should work - thanks agx
0
 
_agx_Commented:
... Or get rid of / substitute the <p> elements in #disclaimer#. Basically structure the html content differently so the CSS styles inherit properly ie display the way you want them.
0
 
JohnMac328Author Commented:
Ok - thanks again
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.