473,387 Members | 1,585 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,387 software developers and data experts.

Text of comments goes over boundary

145 100+
I have 3 column of css on my webpage, on the webpage user can enter their comments which will be saved in database. And then the comments from database is retrieve and displayed on the webpage.

My problem is the comments is long and when displayed on the webpage it goes out of bound of the center column.I want it to go under as in paragraph How can this be solved? I think the code that retrieve and displayed the comments should be changed or the database.

Expand|Select|Wrap|Line Numbers
  1. sql2 = "SELECT * FROM Cadangan";
  2.             rs = Server.CreateObject("ADODB.Recordset");
  3.             rs.Open(sql2,Conn);
  4.  
  5.             out ="<table width="200">";
  6.  
  7.             while(!(rs.EOF))
  8.             {
  9.  
  10.                 out += "<tr><td>"
  11.                 out += rs("Cadangan") + "</td></tr>"
  12.                 out += "<tr><td>" + rs("Nama") + "</td>"
  13.                 out += "<td>" + rs("Email")
  14.                 out += "</td></tr>"
  15.  
  16.  
  17.                 rs.MoveNext();
  18.  
  19.  
  20.             }
  21.  
  22.             out += "</table>"
  23.             var line ="<hr>"
  24.             rs.Close();
  25.             Response.Write(out);
  26.  
May 26 '10 #1
5 1799
jhardman
3,406 Expert 2GB
is RS("cadangan") the comments?

Jared
May 28 '10 #2
puT3
145 100+
yes RS("cadangan") is the comments
Jun 1 '10 #3
jhardman
3,406 Expert 2GB
without looking at the final, formatted page, I see two possibilities. 1- the rs("cadangan") contains HTML code that interfere with the rest of your formatting, or 2- your css code is restricting the size of the td element and allowing the content to spill out. Is it possible that #1 is happening?

Jared
Jun 2 '10 #4
puT3
145 100+
i've tried delete the html code but the result is still the same and I do not define table element in css.

I try another way, i put new code in my CSS and tried do it but the result still the same. Here is the code:

CSS Code for comment:

Expand|Select|Wrap|Line Numbers
  1. div.comment.list{
  2.     float:left;
  3.     width:360px;}
  4.  
  5. .comment_body{padding-top: 4px;}
  6.  
  7. .comment_content{
  8.     padding-left:2px;
  9.     border-bottom: 1px solid #D6D6D6;
  10. }
CSS code for column:

Expand|Select|Wrap|Line Numbers
  1. #content{
  2.    width: 720px;
  3.    margin: 0 auto;
  4. }
  5.  
  6. #colOne{
  7.     float: left;
  8.     width: 160px;
  9. }
  10.  
  11. #colTwo{
  12.     float: left;
  13.     width: 360px;
  14.     padding: 0 20px;
  15. }
  16.  
  17. #colThree{
  18.     float: left;
  19.     width: 160px;
  20. }
ASP code:

Expand|Select|Wrap|Line Numbers
  1. out ="<div class='comment_list'>"; 
  2.  
  3.             while(!(rs.EOF)) 
  4.             { 
  5.  
  6.                 out += "div class='comment_body'>" + rs("Cadangan")
  7.                 out += "<p>" 
  8.                 out += "div class='comment_content'>" + rs("Nama") + "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" + rs("Email")
  9.                 out += "<p></div>" 
  10.  
  11.  
  12.                 rs.MoveNext(); 
  13.  
  14.  
  15.             } 
  16.  
  17.             out += "</div>" 
  18.             rs.Close(); 
  19.             Response.Write(out);
Jun 3 '10 #5
puT3
145 100+
I already figure out the solution.Thanks
Jun 7 '10 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: KathyB | last post by:
Sorry this is a bit of a repost because I wasn't quite accurate in my original. I have an hmtl page with a function to see if there are any input type=text boxes. If so, that means a user did...
2
by: Lovely Angel For You | last post by:
Dear Friends Hope you all are doing great. I am using a form to add text data to the database. With this form I am also using a file field to upload a image file. To use the first thing that...
13
by: ACC | last post by:
Hi! I'm developing an application to analyze some information that is inside a text file. The size of the text file goes from 50Mb to 220Mb... The text file is like a table, with "rows" and...
31
by: Claude Yih | last post by:
Hi, everyone. I got a question. How can I identify whether a file is a binary file or an ascii text file? For instance, I wrote a piece of code and saved as "Test.c". I knew it was an ascii text...
1
by: hostricity | last post by:
When you have an image set with text to the left or the right that does not fill up the entire area next to the picture, How do you force the next block of text to go below the picture? With tables...
5
by: JRD | last post by:
Greetings, I was wondering if anyone has come across a scenario and like this and what solution did you use. I have a datagrid that is populated from the database with the list of drugs and...
2
by: Slain | last post by:
I have a big list of HTML files, which need to be updated with a common text. <script language=JavaScript src="./highlight.js"></script> I need to add the above line in each of the html...
9
by: Steven Bethard | last post by:
I have some text and a list of Element objects and their offsets, e.g.:: ... (etree.Element('a'), 0, 21), ... (etree.Element('b'), 11, 18), ... (etree.Element('c'), 18, 18), ... ] ...
1
by: plumba | last post by:
Hi all. I have a form which has a table and within the rows of the table are simple text input boxes. The ONLY problems with this is that when the form is posted (in text format) if the number of...
1
by: jerger | last post by:
I have not made a program or page from start yet. I have made modifications to our signoff asp pages like changing the questions, texts, shortening field lengths etc... I also have copied the files...
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:
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.