473,385 Members | 1,464 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Linenumber positioning in front of lines

Hi,

I already tried all positioning combinations I could think of without
succes. Here is what I try to achieve:

If want to have a floating text (no divs allowed, only spans) where
linenumber appear in front of the text lines (being indented a certain
space).

It should look like:

1 The quick brown fox jumps over the lazy dog
The quick brown fox jumps over the lazy dog
The quick brown fox jumps over the lazy dog
The quick brown fox jumps over the lazy dog
5 The quick brown fox jumps over the lazy dog
The quick brown fox jumps over the lazy dog
The quick brown fox jumps over the lazy dog
The quick brown fox jumps over the lazy dog
The quick brown fox jumps over the lazy dog
10 The quick brown fox jumps over the lazy dog

Of course, and this is probably the hard part ;-), if the lines wrap,
they should align with the rest of the text, not with with linenumbers.

Any help is very much appreciated.

Jan.

Jul 20 '05 #1
5 2074
Jan Schneider wrote:
If want to have a floating text (no divs allowed, only spans) where
linenumber appear in front of the text lines (being indented a certain
space).


This should get you most of the way:

<URL:http://simon.incutio.com/demos/css/numbered-code-listings.html>

--
Jim Dabell

Jul 20 '05 #2
Jan Schneider:
It should look like: 1 The quick brown fox jumps over the lazy dog
The quick brown fox jumps over the lazy dog
The quick brown fox jumps over the lazy dog
The quick brown fox jumps over the lazy dog
5 The quick brown fox jumps over the lazy dog
The quick brown fox jumps over the lazy dog
The quick brown fox jumps over the lazy dog
The quick brown fox jumps over the lazy dog
The quick brown fox jumps over the lazy dog
10 The quick brown fox jumps over the lazy dog Of course, and this is probably the hard part ;-), if the lines wrap,
they should align with the rest of the text, not with with linenumbers.


Do you mean like this?

1 The quick brown fox jumps over the
lazy dog
The quick brown fox jumps over the
lazy dog
The quick brown fox jumps over the
lazy dog
The quick brown fox jumps over the
lazy dog
5 The quick brown fox jumps over the
lazy dog
The quick brown fox jumps over the
lazy dog
The quick brown fox jumps over the
lazy dog
The quick brown fox jumps over the
lazy dog
The quick brown fox jumps over the
lazy dog
10 The quick brown fox jumps over the
lazy dog
Or like this?

1 The quick brown fox jumps over the
lazy dog The quick brown fox jumps
over the lazy dog The quick brown
fox jumps over the lazy dog The
5 quick brown fox jumps over the
lazy dog The quick brown fox jumps
over the lazy dog The quick brown
fox jumps over the lazy dog The
quick brown fox jumps over the lazy
10 dog The quick brown fox jumps over
the lazy dog The quick brown fox
jumps over the lazy dog The quick
brown fox jumps over the lazy dog
Or perhaps even like this?

1 The quick brown fox jumps over the
lazy dog The quick brown fox jumps
over the lazy dog The quick brown
fox jumps over the lazy dog The
quick brown fox jumps over the
5 lazy dog The quick brown fox jumps
over the lazy dog The quick brown
fox jumps over the lazy dog The
quick brown fox jumps over the lazy
dog The quick brown fox jumps over
the lazy dog The quick brown fox
10 jumps over the lazy dog The quick
brown fox jumps over the lazy dog
Or some other way?

--
Bertil Wennergren <be******@gmx.net> <http://www.bertilow.com>
Jul 20 '05 #3
On Mon, 30 Jun 2003 13:58:45 +0200, Jan Schneider <ja********@gmx.de>
wrote:
I already tried all positioning combinations I could think of without
succes. Here is what I try to achieve:

If want to have a floating text (no divs allowed, only spans) where
linenumber appear in front of the text lines (being indented a certain
space).

It should look like:

1 The quick brown fox jumps over the lazy dog
The quick brown fox jumps over the lazy dog
The quick brown fox jumps over the lazy dog
The quick brown fox jumps over the lazy dog
5 The quick brown fox jumps over the lazy dog
The quick brown fox jumps over the lazy dog
The quick brown fox jumps over the lazy dog
The quick brown fox jumps over the lazy dog
The quick brown fox jumps over the lazy dog
10 The quick brown fox jumps over the lazy dog

Of course, and this is probably the hard part ;-), if the lines wrap,
they should align with the rest of the text, not with with linenumbers.


Looks rather like a table to me. Any strong objections to using a table?

--
Stephen Poley

http://www.xs4all.nl/~sbpoley/webmatters/
Jul 20 '05 #4
Jan Schneider <ja********@gmx.de> wrote:
I already tried all positioning combinations I could think of
without succes.
Maybe the explanation resides in the contradiction of terms.
Here is what I try to achieve:

If want to have a floating text (no divs allowed, only spans) where
linenumber appear in front of the text lines (being indented a
certain space).
Let me get this straight: You want to have text that _must not_ contain
<div> markup, only <span> (anything else allowed? no? real <span>ism),
yet it should be divided into what common people call "lines"?

So what is the mystical reason for requiring the use of markup that
contradicts the logical meaning?
1 The quick brown fox jumps over the lazy dog
The quick brown fox jumps over the lazy dog
The quick brown fox jumps over the lazy dog
The quick brown fox jumps over the lazy dog
5 The quick brown fox jumps over the lazy dog


That's very interesting, but what's your HTML markup? Have you got a
real reason for not making the line numbers part of the content proper,
i.e. do you insist on _not_ having them in the vast majority of
browsing situations at present?

You might consider using markup that lumps every five lines together,
but why don't you as well put the numbers there?

--
Yucca, http://www.cs.tut.fi/~jkorpela/
Jul 20 '05 #5
On Thu, 03 Jul 2003 16:10:15 +0200, Jan Schneider <ja********@gmx.de>
wrote:
Stephen Poley wrote:
On Mon, 30 Jun 2003 13:58:45 +0200, Jan Schneider <ja********@gmx.de>
wrote:
If want to have a floating text (no divs allowed, only spans) where
linenumber appear in front of the text lines (being indented a certain
space).

It should look like:

1 The quick brown fox jumps over the lazy dog
The quick brown fox jumps over the lazy dog
The quick brown fox jumps over the lazy dog
The quick brown fox jumps over the lazy dog
5 The quick brown fox jumps over the lazy dog
The quick brown fox jumps over the lazy dog
The quick brown fox jumps over the lazy dog
The quick brown fox jumps over the lazy dog
The quick brown fox jumps over the lazy dog
10 The quick brown fox jumps over the lazy dog

Of course, and this is probably the hard part ;-), if the lines wrap,
they should align with the rest of the text, not with with linenumbers.
Looks rather like a table to me. Any strong objections to using a table?

Yes, it has to be floating text.


You can float a table. I don't see what the problem really is.

--
Stephen Poley

http://www.xs4all.nl/~sbpoley/webmatters/
Jul 20 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Paul L | last post by:
I'm using SAX to parse a valid XML document without a DTD. If the document has extra whitespace as blank lines, the lineNumber reported by the Locator is in correct, by a line or two. Is their some...
0
by: BB | last post by:
I have an image in a table cell and several lines of text inside a second cell (see below) and the text moves into a skinny column as I make the window smaller. This is a nice feature, but my job...
4
by: Jane Withnolastname | last post by:
I am trying to re-work an old site by replacing the html with css. On the main page, I have a logo image which I needed centred on the initial screen. I found the solution here:...
0
by: Jonas Smithson | last post by:
<div style="position: relative;> <!-- I'm the parent --> blah blah blah <div style="position: absolute; bottom: 0;> <!-- I'm the child --> blah blah blah </div> </div> The bottom of the...
3
by: SirPoonga | last post by:
Can I determine how many lines an xml file has so I can say something like "line 4 of 254"?
2
by: Jawiko | last post by:
I am trying to place objects like buttons, calendar, listboxes etc on a webform. I am strugling with the positioning. I placed all the objects in a cell and the cell centers itself on the page....
1
by: Eric M L | last post by:
I am wondering if I am alone with this problem. Using VS 2005, I must validate an XML file via a Schema and it works well. When I get the schema exception and check the LineNumber and...
6
by: eight02645999 | last post by:
hi wish to ask a qns on strip i wish to strip all spaces in front of a line (in text file) f = open("textfile","rU") while (1): line = f.readline().strip() if line == '': break print line
5
by: Anns via AccessMonster.com | last post by:
My establishment has about 20 ms access db's that will be converted over (see subject). When we pull all the BE's over to SQL and the FE's on Sharepoint (.net) surely we don't have to change...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.