/    Sign up×
Community /Pin to ProfileBookmark

How to write text without wrapping

Hi y’all JS gurues!

Is there any posibility to do this:
I write a text with length 80+

i.e. (pls copy and paste this piece of code, and you’ll see)

<HTML>
<FONT FACE=”Courier” SIZE = 2>
123456789’123456789’123456789’123456789’123456789’123456789’123456789’123456789’123456789’123456789’123456789’123456789′
MY LONG NAME—————————————————–64.263.300————64.263.300————64.263.300
</FONT>
</HTML>

I don’t know why the numeric line is written without wrapping, while the text line is not (the characters after pos.87 are being wrapped to the next line)

I need both lines to be written without wrapping.

Any suggestion? This could be probably a HTML issue instead of JS issue … (?)

Thanx In Advance.

to post a comment
JavaScript

8 Comments(s)

Copy linkTweet thisAlerts:
@freefallJul 10.2003 — <i>
</i>&lt;HTML&gt;
&lt;FONT FACE="Courier" SIZE = 5&gt;
&lt;pre&gt;
123456789'123456789'123456789'123456789'123456789'123456789'123456789'123456789'123456789'123456789'123456789'123456789'
MY LONG NAME-----------------------------------------------------64.263.300------------64.263.300------------64.263.300
&lt;/pre&gt;
&lt;/FONT&gt;
&lt;/HTML&gt;


The <pre> will write it however you format it in your editor, returns, tabs, etc.

  • - Ian
  • Copy linkTweet thisAlerts:
    @David_HarrisonJul 10.2003 — If you know what you're going to write and therefore how long the line will be, then you could have this:

    <div width="x">Some content</div>
    Copy linkTweet thisAlerts:
    @JonaJul 10.2003 — [font=arial][color=maroon]There is the <nobr>Long string of text</nobr> tag, if you mean that. Or, there is just simple entities that allow you to do more than one space in a row. Example, if you put [space][space] the result will appear as one [space]. So instead, you use [space]&amp;nbsp; which will result in [space][space] being visible in the document.



    Two spaces:



    _ _



    A space and an ASCII entity:



    _ &nbsp;_[/color]
    [/font]

    [b][J]ona[/b]
    Copy linkTweet thisAlerts:
    @David_HarrisonJul 10.2003 — I was thinking of suggesting the nobr tag but I think it only works with Netscape and IE.
    Copy linkTweet thisAlerts:
    @JonaJul 10.2003 — [i]Originally posted by lavalamp [/i]

    [B]I was thinking of suggesting the nobr tag but I think it only works with Netscape and IE. [/B][/QUOTE]


    [font=arial][color=maroon]You're right, it shouldn't be used. I can't seem to find it in the HTML 4.01 Recommendation.[/color][/font]

    [b][J]ona[/b]
    Copy linkTweet thisAlerts:
    @freefallJul 10.2003 — Is <pre> bad to use, I mean would you recommend it? I've never used it, but it works for this problem, and it can be any font. Lemme see... it's defined in HTML 3.2 and the W3C DOM

  • - Ian
  • Copy linkTweet thisAlerts:
    @JonaJul 10.2003 — [i]Originally posted by freefall [/i]

    [B]Is <pre> bad to use, I mean would you recommend it? I've never used it, but it works for this problem, and it can be any font. Lemme see... it's defined in HTML 3.2 and the W3C DOM[/B][/QUOTE]


    [font=arial][color=maroon]Yes, I'd recommend it. Using element such as <xmp> work but are depreacated--<pre> is not.[/color][/font]

    [b][J]ona[/b]
    Copy linkTweet thisAlerts:
    @CalibanauthorJul 10.2003 — Hi y'all, JS gurues!

    Finally, I used the "<PRE></PRE>" tag

    Even I used to create a variable, like this

    newElem = document.createElement("pre");

    ... and everything worked fine.


    By the way, I built a tree-generator, using no tables but text only; I just needed something like "<PRE>" to finalize it. The tree is generated in this way:

    1) A table is built, with the content of the tree

    2) The table is read in order to build the tree

    3) The tree is shown

    If anyone is interested ...



    Thanx everybody for your interest in this issue. I think everybody here is a guru except me ?
    ×

    Success!

    Help @Caliban spread the word by sharing this article on Twitter...

    Tweet This
    Sign in
    Forgot password?
    Sign in with TwitchSign in with GithubCreate Account
    about: ({
    version: 0.1.9 BETA 5.18,
    whats_new: community page,
    up_next: more Davinci•003 tasks,
    coming_soon: events calendar,
    social: @webDeveloperHQ
    });

    legal: ({
    terms: of use,
    privacy: policy
    });
    changelog: (
    version: 0.1.9,
    notes: added community page

    version: 0.1.8,
    notes: added Davinci•003

    version: 0.1.7,
    notes: upvote answers to bounties

    version: 0.1.6,
    notes: article editor refresh
    )...
    recent_tips: (
    tipper: @AriseFacilitySolutions09,
    tipped: article
    amount: 1000 SATS,

    tipper: @Yussuf4331,
    tipped: article
    amount: 1000 SATS,

    tipper: @darkwebsites540,
    tipped: article
    amount: 10 SATS,
    )...