Click to See Complete Forum and Search --> : Expanding table problem


nickcrispini
10-05-2003, 10:01 PM
I want to display the contents of a recordset in an HTML table to nicely format it.

The recordset contains about six fields from the database. The problem is some of the the fields have a large amount of text. When I insert the text in the table the cell just expands instead of the text wrapping.

E.G. (or something like this)

(Doesn't wrap - What happens)
The recordset contains about six fields The recordset contains about six fields.

(Wraps - What I want)
The recordset contains about six fields
The recordset contains about six fields.

To me this sounds like a stupid scenario where there's a simple answer. However I've battled with it for hours with no joy.

If you don't specify 'no wrapping' in HTML, fair enough it doesn't wrap and visa verse. I haven't specified 'no wrapping'. I've also set the table and table cells to a specific pixel width.

Does anyone have a solution???

Nick.

PeOfEo
10-05-2003, 10:22 PM
<td nowrap> will not wrap a cell. I am not sure if this attribute was depreciated by the w3 or not but it works. Just put it into ur data base. One more thing you might try is in the spaces run a replace statemennt or something and incert a &amp;nbsp; non breaking space, that should stop the wrap. http://msdn.microsoft.com/library/default.asp?url=/workshop/author/dhtml/reference/properties/nowrap.asp Ok what I just linked was msdn thing I just found and the nowrap element is not valid html4.01 in strict dtd according to the w3 list of attributes.

pyro
10-05-2003, 10:29 PM
Yes, nowrap (http://www.w3.org/TR/REC-html40/struct/tables.html#adef-nowrap) has been depreciated in favor of the CSS2 white-space (http://www.w3.org/TR/REC-CSS2/text.html#white-space-prop) property.

PeOfEo
10-05-2003, 10:36 PM
Originally posted by pyro
Yes, nowrap (http://www.w3.org/TR/REC-html40/struct/tables.html#adef-nowrap) has been depreciated in favor of the CSS2 white-space (http://www.w3.org/TR/REC-CSS2/text.html#white-space-prop) property. Well It says loose dtd I thought that meant it is still legal in loose but depreciated in strict.

nickcrispini
10-05-2003, 11:09 PM
I think you misunderstood. I want it to wrap and not expand the cell.

Please advise.

Thanks.

PeOfEo
10-06-2003, 01:55 PM
Just specify a max width of the cell in pixils in you data grid code.