Displaying Sometimes tabular data in HTML

Posted on 2006-04-03
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:

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?

Question by:ResolvLLC
    LVL 23

    Accepted Solution

    when you grab the variable out of databae try this.

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

    Author Comment

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

    Author Comment

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

    Author Comment

    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

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Join & Write a Comment

    Turn A Profile Picture Into A Cartoon Using Photoshop And Illustrator This tutorial will teach you how to make a cartoon style image out of a regular picture. I have tried to keep the tutorial as simple as possible. I used Adobe CS4 for this tuto…
    Introduction In this tutorial, I'll explain how to create an animated progress meter in a wireframe prototype developed using Axure RP 7.0 - a leading prototyping tool for designing web sites and software. (For more information about Axure and gett…
    The purpose of this video is to demonstrate how to automatically show related posts at the bottom of a blog post in WordPress. This will be demonstrated using a Windows 8 PC. Plugin “Yet Another Related Posts Plugin” will be used. Go to your…
    The purpose of this video is to demonstrate how to manually back up a WordPress Database. This will be demonstrated using a Windows 8 PC. The Host used will be Log into your Hosting account. IPage will be used for demonstration : Locat…

    729 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    20 Experts available now in Live!

    Get 1:1 Help Now