Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7706323
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T00:05:53+00:00 2026-06-01T00:05:53+00:00

I know modern browsers remove most space chars and ‘&nbsp’; characters insider a paragraph

  • 0

I know modern browsers remove most space chars and ‘&nbsp’; characters insider a paragraph element. But is there a way to get the browser to not remove the space chars?

Maybe a CSS attribute, or HTML doctype to use?

Or maybe my last resort is to use javascript to convert every 4 space characters to tabs?

Example of the text I want to display:

<p>There    should    be    gaps    of    4    chars    tween    each    word</p>

If my only resort is Javascript; can you tell me if my regular expression will correctly change any ” ” char(that occurs twice or more) with an “_” char?

var p = document.getElementById("myP");
var con = p.innerHTML;
con = con.replace("[ ]{2,}", "_");
p.innerHTML = con;
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T00:05:54+00:00Added an answer on June 1, 2026 at 12:05 am

    Is there any reason using <pre> tags wouldn’t be suitable for this? Because that’s what it sounds like you need.

    Output (wrapped your content above in <pre></pre> tags):

    There    should    be    gaps    of    4    chars    tween    each    word

    Also, <pre> tags can still be styled.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Okay, so we all know that most modern browsers (without tweaking) are set to
I know that modern browsers will allow URIs with spaces in them, and I
I know that modern browsers generally have two render mode: standard mode and quirk
How do i deploy a java applet for modern browsers? I know there are
All, My application supports IE7+, MOZILLA and other modern browsers. Anybody know of a
Now that most modern browsers support AJAX and client-side requests without performing a POST,
I know I can save a canvas to PNG file easily with modern browsers.
Question: How do I syntax-check my XML in modern browsers (anything but IE)? I've
Modern browsers have multi-tab interface, but JavaScript function window.showModalDialog() creates a modal dialog that
According to http://caniuse.com/script-defer , most browsers support the script tag's defer attribute. I would

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.