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

Displaying text in an asp.net table

I am using an asp.net table to display postings in a classifieds website.

This is a section of the HTM I am using...

<asp:table id="tblAdvert" Width="466px" Height="78px" runat="server"
BackColor="Gainsboro" BorderStyle="Solid" BorderWidth="1px"
BorderColor="MidnightBlue" GridLines="Both" CellSpacing="0">
<asp:TableRow>
<asp:TableCell></asp:TableCell>
</asp:TableRow>
...
<asp:TableRow>

And then I fill the table like this (in the code-behind) ...
tblAdvert.Rows(3).Cells(0).Text = advert.Description

The problem is that the text all gets displayed in one paragraph, even
though the user

might have added lines when they entered the posting.

So I tried this...
tblAdvert.Rows(3).Cells(0).Text = "<pre class=advertdescription>" &
advert.Description &

"</pre>"

This expands the table so that it stretches out, and the user has to scroll
horizontally

to see the whole posting.

Any suggestions ? Thanks,
Craig
Nov 22 '05 #1
2 2811
I think, but I'm not an ASP/HTML programmer really that you need to replace
the new line char (chr(13)) in your text to a break row in HTML (<br>????)

Hope it sparks an idea.
Chris

"Craig HB" <Cr*****@discussions.microsoft.com> wrote in message
news:11**********************************@microsof t.com...
I am using an asp.net table to display postings in a classifieds website.

This is a section of the HTM I am using...

<asp:table id="tblAdvert" Width="466px" Height="78px" runat="server"
BackColor="Gainsboro" BorderStyle="Solid" BorderWidth="1px"
BorderColor="MidnightBlue" GridLines="Both" CellSpacing="0">
<asp:TableRow>
<asp:TableCell></asp:TableCell>
</asp:TableRow>
...
<asp:TableRow>

And then I fill the table like this (in the code-behind) ...
tblAdvert.Rows(3).Cells(0).Text = advert.Description

The problem is that the text all gets displayed in one paragraph, even
though the user

might have added lines when they entered the posting.

So I tried this...
tblAdvert.Rows(3).Cells(0).Text = "<pre class=advertdescription>" &
advert.Description &

"</pre>"

This expands the table so that it stretches out, and the user has to
scroll
horizontally

to see the whole posting.

Any suggestions ? Thanks,
Craig

Nov 22 '05 #2
Craig HB wrote:
I am using an asp.net table to display postings in a classifieds website.

This is a section of the HTM I am using...

<asp:table id="tblAdvert" Width="466px" Height="78px" runat="server"
BackColor="Gainsboro" BorderStyle="Solid" BorderWidth="1px"
BorderColor="MidnightBlue" GridLines="Both" CellSpacing="0">
<asp:TableRow>
<asp:TableCell></asp:TableCell>
</asp:TableRow>
...
<asp:TableRow>

And then I fill the table like this (in the code-behind) ...
tblAdvert.Rows(3).Cells(0).Text = advert.Description

The problem is that the text all gets displayed in one paragraph, even
though the user

might have added lines when they entered the posting.

So I tried this...
tblAdvert.Rows(3).Cells(0).Text = "<pre class=advertdescription>" &
advert.Description &

"</pre>"

This expands the table so that it stretches out, and the user has to
scroll horizontally

to see the whole posting.

Any suggestions ? Thanks,
Craig

Any characters such as line feeds, carriage returns, tabs, end of page, are
ignored. They are called whitespace in the Web. Will not display except
within a <pre> element.
Nov 22 '05 #3

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

Similar topics

14
by: Akbar | last post by:
Hey there, Big-time curiosity issue here... Here's the test code (it's not that long)... it's to display a large number of image links with captions, ideally pulled in from an external file...
9
by: Susan Bricker | last post by:
Greetings. I am having trouble populating text data that represents data in my table. Here's the setup: There is a People Table (name, address, phone, ...) peopleID = autonumber key There...
0
by: Fronky | last post by:
Hope someone can help. I am still learning, so no laughing please. I am displaying records from a database using Response.Write(""); instead of the usual datagrid method. I am doing it this way...
9
by: Cogito | last post by:
My program builds several tables using inner HTML. All the tables are displayed only when the program terminates. How can I make it display one table at a time and then wait for a click before...
10
by: gnewsgroup | last post by:
I've googled and tried various approaches, but could not resolve this problem. The article at MSDN: Displaying Images in a GridView Column only presents a simple case where all data (including the...
11
by: dba | last post by:
Have been displaying data from database using html for some time but just recently trying to display data back to "form". Can't find answer. <form method="post" action="<?php echo $PHP_SELF;?>">...
1
by: littlealex | last post by:
IE6 not displaying text correctly - IE 7 & Firefox 3 are fine! Need some help with this as fairly new to CSS! In IE6 the text for the following page doesn't display properly - rather than being...
7
by: hsegoy1979 | last post by:
Dear All Iam using file upload control and i want to display image in another pop up page .But image is not displaying in image control iam sending image path thru querystring . here is my code ...
7
by: EManning | last post by:
I'm using A2003 connected to a SQL 2000 backend. This is not an adp. I have a table which I store 0 and -1 for 2 bit fields. I have a listbox on a form based on a query of this table. The...
482
by: bonneylake | last post by:
Hey Everyone, Well i am not sure if this is more of a coldfusion problem or a javscript problem. So if i asked my question in the wrong section let me know an all move it to the correct place. ...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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: 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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...

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.