Click to See Complete Forum and Search --> : Might be a stupid question...
ikklezoe
09-12-2005, 05:02 AM
OK, this might be a stupid quesiton, but...
I have a page that dumps a string into an html table... but it's really, really long, so it goes off the page...
How can I set the TD property so that the text wraps, but stays in one cell? I need to cut and paste the cell, so it has to remain one unbroken string...
Any ideas??
Cheers,
zo
Charles
09-12-2005, 05:20 AM
Don not use TABLEs for layout and your problem is solved.
the tree
09-12-2005, 05:56 AM
Charles, how do you know that she isn't using a table for semantic purposes?
cell "data" naturally wraps, unless you have added something to prevent wrapping.
We need to se the document.
ikklezoe
09-12-2005, 06:16 AM
Thanks guys :) Yeah - I have to use the table, unfortunately... OK, here's that cell - let me know if you need more...
<tr>
<td valign=top>
<p class=title1Green>CDB Search and Analysis Tool URL Generator</p>
<p>Please cut and paste the following URL into your browser to query the database directly</p>
<BR>
https://oraweb.cern.ch/pls/cdbsqldev/web.show?p_fld1=hostname&p_data1=lxde&p_hostname=yes&p_clustername=yes&p_clustersubname=yes&p_operatingsystem=yes&p_kernel=yes&p_state=yes&p_domain=yes&p_hwaddress=yes&p_vendor=yes&p_serialnumber=yes&p_contracttype=yes&p_quattor=yes&p_importance=yes&p_hwmodel=yes&p_sysfunction=yes&p_clustype=yes&p_contractid=yes&p_rackname=yes&p_default=yes&p_quat=all&p_outputformat=xml
<br><br>
409
<br><br>
<p>This URL will give you an XML output. If you would like a different format, you can change xml to html or excel.</p>
<br><br>
</td>
</tr>
A link to the page would be more useful
ikklezoe
09-12-2005, 06:35 AM
sorry - I can't do that - it's on an internal server not accessible from outside the organisation I work at :-s
It's impossible to say without knowing the structure of the table and the applied css.
Try adding style="white-space:normal;" to the offending element
ikklezoe
09-12-2005, 06:50 AM
Nope, no dice... But thanks Fang :) Not sure what else I can try, but I'll keep at it :)
muneepenee
09-12-2005, 07:05 AM
1. eezeer tudu:
<td><pre>
line 1
line 2
line 3
line 4
</td>
(dont weree bout missing </pre>
abhi007
09-12-2005, 07:46 AM
this is very simple,, use
<td>
<p> </P>
<p>... </p>
so on..
and apply proper width of the cell in pixel or % what you want...
apply align and Valign as you want
Cheers
the tree
09-12-2005, 10:09 AM
1. eezeer tudu:
<td><pre>wtf? <pre> directly prevents content from wrapping.
(dont weree bout missing </pre>Yes do, that'd cause an invalid document.
ikklezoe
09-12-2005, 10:14 AM
Yeah, I'm at a bit of a loss now!!
The width of the table is set, but it gets ignored... the <p>'s don't help, style sheets don't help.... I was parsing the string to split it up, but unfortunately it has to be one continuous string...
Any more ideas, anyone??
Charles
09-12-2005, 10:20 AM
Any more ideas, anyone??Stop using TABLEs for layout and start using valid HTML.
ikklezoe
09-12-2005, 10:23 AM
Yeah, I heard that one before too....I don't have any choice in the matter, but thanks...
ikklezoe
09-12-2005, 10:24 AM
Tim Berners Lee fan, eh?? Nice... then you should know what CERN is.... and that's where I work... Don't speak to me like I'm an idiot
Is there another cell in the column that is causing the problem?
the tree
09-12-2005, 11:27 AM
You could create a div wich is nearly the width of the cell and style that as you like.
Charles wasn't trying to be patronising, just trying to get his point across.
ikklezoe
09-12-2005, 12:08 PM
Fair enough... Then I apologise for being rude...
Thanks for all your help guys... I'll give all those things a try and let you know how it goes tomorrow :)
zo
Charles
09-12-2005, 06:23 PM
then you should know what CERN is.... and that's where I workThen you'll understand that the internet has certain rules and you should expect things to go awry when you break them. From the HTML 4.01 Specification:Tables should not be used purely as a means to layout document content as this may present problems when rendering to non-visual media. Additionally, when used with graphics, these tables may force users to scroll horizontally to view a table designed on a system with a larger display. To minimize these problems, authors should use style sheets to control layout rather than tables.
Nedals
09-12-2005, 06:43 PM
I second Fang.
There's something you are not telling us
A table cell will automically wrap text. The cell width will be controlled by the table width or the width of the screen. It should not extend beyond the screen width unless you tell it to.
One way to cause the effect, however, is to include continious text. By that I mean NO spaces, which it not what your example shows.
Can you post, or attach, the entire table?
ikklezoe
09-13-2005, 02:47 AM
OK... Charles...thanks for the advice and quotes again, blah blah blah, as I said I don't get to choose how the entire organisation structures their website... Write a letter to the head of IT if you like, but telling me to change something I can't change is not only unhelpful, it's fekkin arrogant.... Plus, I apologised for being rude, you could at least have the good grace to accept the apology and actually listen to what I'm saying... Please don't bother posting in this discussion again, because you clearly don't have anything useful to contribute...
Fang and Nedals...I can post the whole html file if you like, but it's absolutely massive. I do have it set to 80% and most of the time it conforms to that... It's just with this long string that it doesn't, so what you said about NO spaces is probably correct...
Thanks for all the comments... I'll keep on trying... Please don't think I'm a cow for the way I'm speaking to Charles, I just have a slight raw nerve for people patronising me...
Zip the document and we'll take a look
ikklezoe
09-13-2005, 04:40 AM
Thanks :)
It really is enormous though - the first parts of the table that are header and menu are templates - they have nothing to do with me, though obviously I can add to them...as well as the footer...
Why not have the url as a link?
Another option is to use style="width:500px;overflow:scroll;" on the element.