|
|
Xaphan 01-08-2003, 12:02 PM I've got a web page that reads from a database and displays 11 fields, 2 of which are memo fields. The width is wider than an average screen. What is happenning, however, is if the user, when entering into one of the memo fields, does not hit enter, then when it displays on this page, it makes it wider and wider and wider. This is because I use the <Pre> </pre> around the text.
What I'd like to do is limit the width of these 2 memo fields' columns, but I can't figure out how. I tried setting the width in the <TD> statement but it doesn't seem to affect it. I can make the statement <TD Width=2000><%=rs("notes")%></td> but the width never changes...whether I have width=200 or width=2000
iNVAR 01-08-2003, 12:13 PM alter your table's width. also, the TD width won't change properly if the cells above or below it are restricting the width. in a table, the columns have to sort of line up unless you have cells merged.
Bohica 01-08-2003, 02:11 PM ie is usually "ok" about making the table look right even when cell widths don't match up or aren't specified, but netscape will completely butcher them ;o
Xaphan 01-08-2003, 02:31 PM well, its a simple table, but I just noticed that the table tag has Width=100%
could that be causing my problem?
Bohica 01-08-2003, 02:32 PM try restricting it to a set number of pixels (like 500 or something).
iNVAR 01-08-2003, 03:29 PM 100% is 100% of the size of the browser window.
btw, php damnit, php!!
I don't know what query language you're using, but you can format the text in that column when you pull it out of the database.
Well, you can in Oracle PL/SQL anyway. :p
Xaphan 01-08-2003, 08:50 PM Access database, IIS server...and I know ASP well, so why bother learning PHP just for a simple list like this... :D
Data, how could I format the data coming out to insert carriage returns using SQL?
I'll try making the table a pixel width...I also inherited this page, and I think its garbage, so I may rewrite the page...
Bohica 01-08-2003, 09:00 PM You can't do processing like that using pure SQL. You'd need to do it in asp (assuming it allows that; i've never used asp).
Originally posted by Bohica
You can't do processing like that using pure SQL. You'd need to do it in asp (assuming it allows that; i've never used asp).
Especially from an Access database. Sorry bro.
Xaphan 01-08-2003, 10:27 PM I didn't think I could...
Zoidberg 01-10-2003, 01:43 AM Make sure the "nowrap" attribute is not there in your TD tag... then the cell should wrap text automatically if the text is longer than the cell dimensions... (whether it finds line breaks or not) If nowrap is on, then the cell will keep expanding until an actual endline is found.
If you used php, php has a wordwrap function :)
But AFAIK, you're SOL in ASP!
edit: sorry. I didn't notice the part where you said the text was between pre tags. There probably isn't anyway unless you write a wordwrap function... cuz preformatted text overrides the other HTML format... hence it being preformatted :)
According to this link...
http://lists.w3.org/Archives/Public/www-html/1999Mar/0060.html
... <pre wrap> should wrap in Netscape, but not in IE. still looking for more info tho...
OK!
Found a couple of ASP Wordwrap functions, Merry Christmas.
http://www.experts-exchange.com/Web/Web_Languages/ASP/Q_20366800.html
http://www.asp101.com/samples/viewasp.asp?file=wordwrap .asp
I'd recommend the second link. Hope that helps.
Ciao.
Zoidberg to the rescue!
Tech: 153278116
Computer Problems: 0
iNVAR 01-10-2003, 11:10 AM hmm didn't realize pre overrides html... that sucks.
Zoidberg 01-10-2003, 03:01 PM Originally posted by invar
hmm didn't realize pre overrides html... that sucks.
Well not really. Preformatted text still accepts bold and underline... and most css text styles (colors, etc). It's just that the layout is preserved (which is good for displaying plaintext files, tab delimited files, etc)
It's got its uses :)
|
|