Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 274
  • Last Modified:

Displaying Sometimes tabular data in HTML

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:

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")

Is there any easy way to do this?

  • 3
1 Solution
Saqib KhanSenior DeveloperCommented:
when you grab the variable out of databae try this.

myNotes = Rs("MemoField")
mynotes = Replace(myNotes, "vbCrlf", "<br>")
Response.write myNotes
ResolvLLCAuthor Commented:
That works great for adding a return, I need tabs.
ResolvLLCAuthor Commented:
Or I need to change the font in <pre>  </pre>
ResolvLLCAuthor 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

Featured Post

[Webinar On Demand] Database Backup and Recovery

Does your company store data on premises, off site, in the cloud, or a combination of these? If you answered “yes”, you need a data backup recovery plan that fits each and every platform. Watch now as as Percona teaches us how to build agile data backup recovery plan.

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now