JohnMac328
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">#disclaime r#</cfoutp ut></p>
It displays but it does not take the css format. Is this not possible?
Thanks
<p class="cssname"><cfoutput query="qryName">#disclaime
It displays but it does not take the css format. Is this not possible?
Thanks
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
ASKER
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">#disclaime r#</cfoutp ut></p>
with
<textarea><cfoutput query="qryName">#disclaime r#</cfoutp ut></texta rea>
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;"><c foutput query="qryName">#disclaime r#</cfoutp ut></p>
see if an inline style will modify the text
FOR TESTING ONLY
replace
<p class="cssname"><cfoutput query="qryName">#disclaime
with
<textarea><cfoutput query="qryName">#disclaime
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;"><c
see if an inline style will modify the text
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.
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.
ASKER
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.
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
ASKER
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>"?
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?
ASKER
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
ASKER
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-We ighted 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>
<p class="smallDisclaimer"><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?
ASKER
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
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.
ASKER
Ok - thanks again
I suspect that the disclaimer variable has its own formatting?