473,385 Members | 1,645 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.

Indenting text from an arraylist...

RAB
I created an arraylist. Some items need to be indented.
....
MyList.Add("Text")
MyList.Add(" Text2")
MyList.Add(" Next text")
.....

I then databind the arraylist with a datalist control. However, the
datalist control does not recognize my spaces and places all text
left-justified. Is there anything I can do to preserve my spaces? The
indentation follow no pattern and are used to create an outline format.

Thanks,
RABMissouri

Nov 19 '05 #1
2 1055
Hello RAB,

I would think you're going to have to add some html formatting in your
display logic. The simplest case would be something along the lines of:

MyList.Add("Text")
MyList.Add(" Text2")
MyList.Add(" Next text")

Or you could probably do something with the <UL> <LI> html elements. Maybe
someone will come up with something more clever for you.

--
brians
http://www.limbertech.com
"RAB" wrote:
I created an arraylist. Some items need to be indented.
....
MyList.Add("Text")
MyList.Add(" Text2")
MyList.Add(" Next text")
.....

I then databind the arraylist with a datalist control. However, the
datalist control does not recognize my spaces and places all text
left-justified. Is there anything I can do to preserve my spaces? The
indentation follow no pattern and are used to create an outline format.

Thanks,
RABMissouri

Nov 19 '05 #2
"RAB" <ra*********@yahoo.com> wrote in
news:11**********************@z14g2000cwz.googlegr oups.com:
I created an arraylist. Some items need to be indented.
...
MyList.Add("Text")
MyList.Add(" Text2")
MyList.Add(" Next text")
....

I then databind the arraylist with a datalist control. However,
the datalist control does not recognize my spaces and places all
text left-justified. Is there anything I can do to preserve my
spaces? The indentation follow no pattern and are used to
create an outline format.

Thanks,
RABMissouri


RAB,

When multiple spaces appear in HTML text, the browser will only
display one space. To display multiple spaces, use the &nbsp;
construct (it stands for "Non Breaking SPace").

So your code could be modified like this:

MyList.Add("Text")
MyList.Add("&nbsp;&nbsp;&nbsp;Text2")
MyList.Add("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Ne xt text")
Run this HTML page to see the difference:

<HTML>
<HEAD>
</HEAD>
<BODY>
Line 1
<BR/>
Line 2
<BR/>
Line&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs p;&nbsp;3
</BODY>
</HTML>
--
Hope this helps.

Chris.
-------------
C.R. Timmons Consulting, Inc.
http://www.crtimmonsinc.com/
Nov 19 '05 #3

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

Similar topics

9
by: bob | last post by:
What tool do most of you people use to indent your code? Doing so by hand is a bit tedious, I think.
4
by: Ron | last post by:
Hi, I need to parse text (ie. created in Notepad) files for numbers (doubles). In Borland C++ Builder the following works: if(!InVect.is_open()) { InVect.open(TxtFileName.c_str()) ; }
2
by: Leon Friesema | last post by:
Hiyall! I have a RichTextBox inside a UserControl which should be able to indent a block off text (or UnIndent for that matter) like the SourceEditor of VS2003 or WinWord does. All controls on...
7
by: Harrie | last post by:
Hi group, I want to indent existing XML files so they are more readable (at least to me). At this moment I'm looking at the XML files OpenOffice.org's Writer application produces in it's zipped...
0
by: D. Shane Fowlkes | last post by:
The Smart Indenting "feature" is driving me absolutlely crazy in VWD. Problem: VWD in Code View insists on tabbing a lot of my code over to it's own liking and effects mainly my comments in the...
1
by: TH | last post by:
Could anyone please explain the bizarre and utterly infuriating effect I am observing while adding controls programmatically? I've reduced the problem to the following code: <form id=Form1...
24
by: garyusenet | last post by:
I'm working on a data file and can't find any common delimmiters in the file to indicate the end of one row of data and the start of the next. Rows are not on individual lines but run accross...
5
by: Smokey Grindle | last post by:
Ok I must admit I stink at regular expressions... been trying to learn them for a while now and its not sticking how I wish it would... but I am trying to take a very long string (about 30KB) and...
0
by: JosAH | last post by:
Greetings, Introduction Before we start designing and implementing our text builder class(es), I'd like to mention a reply by Prometheuzz: he had a Dutch version of the entire bible ...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
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
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
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...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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.