pre

Inserting a newline into a pre tag (IE, Javascript)

In IE when I insert text into a <pre> tag the newlines are ignored: <pre id="putItHere"></pre> <script> function putText() { document.getElementById("putItHere").innerHTML = "first line\nsecond line"; } </script> Using \r\n instead of a plain \n does not work. <br/> does work but inserts an extra blank line in FF, which is not a...

How to center align a pre tag in HTML

I'm trying to post some code on a blog using the pre tag. Something like this: void function(){return 0;} Now I want all this code to be center aligned. I'm not talking just about the text but also about the border around it. The width is set currently to 60%. So I want all of this to be center aligned. Is there a way to do it? ...

I want to use <pre></pre> to keep the format of input text, but the displayed text crosses the boundary of its parental tag<div></div>. How to solve this problem?

The text in <pre></pre> steps beyond the boundary of its parental <div></div>. How to solve this problem? It is said that the line lengths in the preformatted text can be shortened, but how to do it? I have seen <%# DataBinder.Eval(Container.DataItem, "Comments") .ToString().Replace("\n", "<br />") %> Is it c#? I am...

prettify highlightning in a PRE with white-space:nowrap is one line in IE

Hi, In Internet Explorer, a PRE with a style of white-space:nowrap is causing the code in the PRE to be in one single line when I use prettify (http://code.google.com/p/google-code-prettify/). Doesn't a <br/> is supposed to cause a new line in a PRE? I checked the HTML source generated by prettify after the page has loaded and it gener...

How do I convert a db3 file (Palm Pre database) to a MySQL file?

I've copied the db3 database file on my Palm Pre to my computer and would like to convert it to a MySQL database (so I can print the memos). (Or, better, I'd like to find a GUI like PHPMyAdmin that can read the db3 file.) How can I access that data on a PC best? Thanks. Ari ...

How to get the previous word with regex?

Hello, I have a path like this one: C:\Development.TFS\Examn\R4-branch\Web\OrganisationManager\themes\blue\css And I need a regex to get the word "blue" out of there. I tried, but didn't find a solution yet. It's practically getting the word before the last word from that string. Please help, thank you ...

Select everything in a pre box when you click on it?

The select() method only seems to work with textareas and input spaces, and I don't know javascript very well, so I'm not coming up with any solutions. Does anyone know how to highlight everything in a pre box when you click on it? What I'm trying to do is make it so a visitor can easily highlight everything in the pre so they can then...

pre tag- text overflows the box SOLVED but for ie6 (ie7 not tested)

I have applied the following style to the pre element: pre { background-color: #FFFFCC; border: 2px dashed #FF6666; padding-top: 7px; padding-bottom: 8px; padding-left: 10px; float: none; padding-right: 10px; margin: 10px; } The text overflows the box. When I applied the float:right property...

ie6 weird h3 /div behavior - no right margin bug (?) in ff

Help, please. The code - just a styled pre and a styled div (using float and clear) : <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"&gt; <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>Ie bug</title> <style type="text/css"> <!-- pre { ba...

How to use css to change <pre> font size

pre{font-family:cursive;font-style:italic;font-size:xxx-small} How to change pre font size? ...

php Preg_replace_callback problem

Hi I have the following code but im not a big fun of reg exp as they are too confusing: <?php $r = '|\\*(.+)\\*|'; $w = ''; $s = 'hello world *copyMe* here'; function callbk($str){ print_r($str); foreach($str as $k=>$v) { echo $v; } } $t = preg_replace_callback($r,'callbk',$s); //output: Array ( [0] => *copyMe* [1...

The substitute for <pre> tag?

Good days, I am looking for a substitute for pre tag of HTML. In pre tag the things with long lines seems bad sometimes on different resolutions, it gets worse and worse. The thing is I need to use pre tag because the one who will be the updater of the website don't know much HTML and also don't have time. So he should simply copy and ...

HTML pre tag auto-select

Hi there, Is it possible to auto-select the text in a PRE tag without the use of Javascript? ...

Output of multiple post and pre increments in one statement

I'm new to C language so plz sum1 help me out. A C code written int i=3; printf("%d",++i + ++i); Complier gvs O/P =9. How? Thanx in advance ...