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
help posting links to gardenweb
Hi all, Am feeling a bit dense here. May I ask for...
radley
How to post documents from googledoc into Post?
How do I attach a excel, and word documents to a post...
ladyrose65
Bonsai
GardenWeb I hope this post finds you well. I have acquired...
olindha
Cloud Computing
What is the Advantages of Cloud Computing ?
Tinaustin
E-commerce options?
My niece asked for my help in creating a web site for...
jenn
Sponsored Products
Faux Sheepskin Area Rug
Home Decorators Collection
Home Decorators Accent Rug: Faux Sheepskin Chocolate 2' x 3'
$19.00 | Home Depot
Lupine Inc Adjustable Candy Apple Cat Collar - 1/2 in. x 8 - 12 in. - 0865-1390
$26.99 | Hayneedle
Pre-owned Vintage Hickory & Leather Library Chair
Chairish
WW 770022 17.3 ft 5C WHITE Wire 50 LED Christmas Lights
EnvironmentalLights.com
Baxton Studio Neo-Classics Chesterfield Chair
Overstock.com
Faux Sheepskin Area Rug
Home Decorators Collection
Home Decorators Indoor/Outdoor Area Rug: Home Decorators Collection Rugs Faux
$69.00 | Home Depot
People viewed this after searching for:
© 2015 Houzz Inc. Houzz® The new way to design your home™