pre tag vs. white-space:pre style

Richard (chuggerguy)April 9, 2014

this is in
a pre tag

this is in
a white-space:pre div

They seem to look pretty much the same while typing them. "div" is lined up directly under "tag" etc.

<div style="white-space:pre;"> may be a few more characters to type than <pre> but I often add a couple other styles anyway. Such as border and background.

Easier than a table if you just want some quick aligned columns? Or just an alternative method, another tool?

Thank you for reporting this comment. Undo
Richard (chuggerguy)

A B C D
1 2 3 4
5 6 7 8

    Bookmark   April 9, 2014 at 10:19PM
Thank you for reporting this comment. Undo
Richard (chuggerguy)

A B C D
1 2 3 4
5 6 7 8

    Bookmark   April 9, 2014 at 10:21PM
Thank you for reporting this comment. Undo
Richard (chuggerguy)

Not the type of music I typically listen to. I like the electric violin though.

Video is not visible, most likely your browser does not support HTML5 video

Just in case that's South of the Equator...

Video is not visible, most likely your browser does not support HTML5 video

This post was edited by chuggerguy on Fri, Jun 13, 14 at 15:27

    Bookmark   April 28, 2014 at 2:00AM
Thank you for reporting this comment. Undo
Richard (chuggerguy)

Classic Theme Restorer plus I learned to apply a smidgeon of CSS to the UI using userChrome.css. Like removing the hamburger. And to fix "Show Go", which v29 broke. Amazing how many times I find myself sitting on a page wanting a fresh load without resubmitting form data.

A different(leaner?) look within a portable version Firefox I threw together and modified using this as a starting point.

This post was edited by chuggerguy on Wed, Jun 4, 14 at 14:45

    Bookmark   May 4, 2014 at 9:25PM
Thank you for reporting this comment. Undo
doodlebee

The pre tag is for long strings that you don't want broken. Usually used when typing out code. It'll put the entire contents of what's between the pre tags on one line, and add line breaks only when you put one in there. It *will* fall outside of your layout if the space allotted for text is smaller than the amount of content you put in it.

A div is a block of content. It will always take up the full line of where you place it, unless you float it, or display:inline. And don't out styles in your content - that's what CSS is for. Add a class to the div if you want to add a style to it, that way, you can universally edit the style via the class.

If you want tabular columns of data, use a table. That's what they are for.

    Bookmark   June 19, 2014 at 9:43AM
Sign Up to comment
More Discussions
How to embed animated Gifs onto GW?
I tried posting the way chuggeryguy which worked for...
ladyrose65
How to post documents from googledoc into Post?
How do I attach a excel, and word documents to a post...
ladyrose65
CSS3 Image Transforms.
<img width="550px" src="http://chuggerguy.com/pub/forumphotos/images/8start.png"...
Richard (chuggerguy)
help posting links to gardenweb
Hi all, Am feeling a bit dense here. May I ask for...
radley
People viewed this after searching for:
© 2015 Houzz Inc. Houzz® The new way to design your home™