Link to home
Start Free TrialLog in
Avatar of JohnMac328
JohnMac328Flag for United States of America

asked on

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
Avatar of cfEngineers
cfEngineers

can you paste the view-source to see what actually got rendered?

I suspect that the disclaimer variable has its own formatting?
Avatar of JohnMac328

ASKER

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.
try putting static text in there to see if your css is actually modifying the text
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.
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
Avatar of _agx_
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.  
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.
Strip the html from disclaimer text
Strip the html from disclaimer text
I tried it with and without.  I was just curious if I was missing something.
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>"?

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?
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
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>
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?

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?
ASKER CERTIFIED SOLUTION
Avatar of _agx_
_agx_
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
That should work - thanks agx
... 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.
Ok - thanks again