We help IT Professionals succeed at work.

We've partnered with Certified Experts, Carl Webster and Richard Faulkner, to bring you two Citrix podcasts. Learn about 2020 trends and get answers to your biggest Citrix questions!Listen Now

x

Displaying Sometimes tabular data in HTML

ResolvLLC
ResolvLLC asked
on
Medium Priority
288 Views
Last Modified: 2013-12-24
OK, here's the issue, I am reading fields from a database.  One of them is a memo field which sometimes contains tabular data and sometimes does not.  It is a notes field and can contain almost anything.  However, when the notes contain tabs I would like to display them properly, for example:

-----
John, the estimated support will be as follows:

                                Amount
1 to 10 users             $100.00
10  -20                     $200.00
20 + users                $500.00
-----

With the exception that instead of spaces like in the above example, the memo field will actuall contain tabs.

I have tried repalcing tabs with \t and using Java like below but I lose my font in the <pre>:

<SCRIPT LANGUAGE='Javascript'>
                document.write("<font face=\"Arial\" size=\"3\" color=\"#008000\"><pre>")
      document.write("100 Meter\t400 Meter\t1500 Meter\r")
      document.write("110 Hurdles\tHigh Jump\tlong Jump\r")
      document.write("Javelin\t\tPole Vault\tShot Put\r")
      document.write("Discus")
      document.write("</pre></font>")
</SCRIPT>


Is there any easy way to do this?

Luke
Comment
Watch Question

Senior Developer
Commented:
when you grab the variable out of databae try this.

myNotes = Rs("MemoField")
mynotes = Replace(myNotes, "vbCrlf", "<br>")
Response.write myNotes

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts

Author

Commented:
That works great for adding a return, I need tabs.

Author

Commented:
Or I need to change the font in <pre>  </pre>

Author

Commented:
This was a stupid thing on my part.  In the preview in front page this wasn't displaying properly.  Once saved and viewed in IE, it is fine.
Thanks for your help
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.