Jump to content

Getting GetASCSS() to properly interpret tab characters?


This topic is 3546 days old. Please don't post here. Open a new topic instead.

Recommended Posts

So I want to export a text field to a website. The text field has many, many tab characters to set up alignment of lists, indented paragraphs, etc. However, it appears as though GetAsCSS() completely ignores them. However, I know GetAsCSS() sees them, because when I tried to Substitute() them with an html entity, the text becomes full of "&tab;" or "  ..." or whatever. Does anyone have any solutions about how to handle this? I haven't been able to find anything. Any ideas are appreciated.

Link to comment
Share on other sites

it appears as though GetAsCSS() completely ignores them

 

Perhaps what you mean is that the browser rendering the resulting HTML ignores them. Which is the correct thing to do, since by default HTML "collapses" any sequence of white-space characters into a single space. See, for example:

http://webdesign.about.com/od/styleproperties/p/blspwhitespace.htm

http://webdesign.about.com/od/intermediatetutorials/qt/tiphtmltab.htm

Link to comment
Share on other sites

Perhaps what you mean is that the browser rendering the resulting HTML ignores them. Which is the correct thing to do, since by default HTML "collapses" any sequence of white-space characters into a single space. See, for example:

http://webdesign.about.com/od/styleproperties/p/blspwhitespace.htm

http://webdesign.about.com/od/intermediatetutorials/qt/tiphtmltab.htm

I know, but I want to force it not to do that. So if I could make it understand &tab; or something, that would be ideal.

Link to comment
Share on other sites

by default HTML "collapses" any sequence of white-space characters into a single space.

 

I know, but I want to force it not to do that.

 

The way to force the browser to respect white-space characters literally, is to use the <pre> tag.

 

Note that the purpose of GetAsCSS() is to preserve text styles  (bold, italic, color, etc.) not the field's overall formatting. I am not sure why you have "many, many tab characters to set up alignment of lists, indented paragraphs, etc." all in a single text field. It sounds like you could benefit from splitting the data into individual fields. Also, if you are serious about publishing the data on the web, consider exporting it as XML and use XSLT to create the HTML document with all the necessary HTML/CSS bells and whistles. Transforming your text field - formatted (I presume) to display correctly in Filemaker - to a web page as-is, with no further adjustments. is not likely to produce the best result.

Link to comment
Share on other sites

The way to force the browser to respect white-space characters literally, is to use the <pre> tag.

 

Note that the purpose of GetAsCSS() is to preserve text styles  (bold, italic, color, etc.) not the field's overall formatting. I am not sure why you have "many, many tab characters to set up alignment of lists, indented paragraphs, etc." all in a single text field. It sounds like you could benefit from splitting the data into individual fields. Also, if you are serious about publishing the data on the web, consider exporting it as XML and use XSLT to create the HTML document with all the necessary HTML/CSS bells and whistles. Transforming your text field - formatted (I presume) to display correctly in Filemaker - to a web page as-is, with no further adjustments. is not likely to produce the best result.

 

That is so helpful, thank you! The reason there are so many indented lists is because it's a policy handbook.

Link to comment
Share on other sites

This topic is 3546 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.