Controlling table widths and ignoring word lengths...

liunx

Guest
Greetings!<br />
<br />
Alright, so I'm making a table in a cgi-script, and everything looks fine.<br />
<br />
That is, until the script gives me a response that is veeeeeeeeeeeeeery long and puts it in a table data.<br />
<br />
This makes my table ignore it's manually set fixed width and expand it in order to accomodate the whole long answer (which is one "word", ie. no whitespace).<br />
<br />
So it seems that Explorer is unable to "cut" apart single words in order to respect the width I want width my current HTML design.<br />
<br />
Has anyone any idea how to enforce my requested table width despite of this? (And no, I cannot change the response from the script, since it's directory paths and stuff which it prints.)<br />
<br />
Sincerely, Robert<!--content-->As far as I know, there is no way around this except to divide up the "word" with spaces, which you said you cannot do.<br />
<br />
It doesn't matter what widths you define for your table cells, if a single word is entered in there that is wider than the table cell itself, it will always override the cell width making it wide enough to fit the word in.<br />
<br />
To the best of my knowledge, there is no way around this problem.<!--content-->Aww, too bad.<br />
<br />
Well, thank you for the information!<br />
<br />
/Robert<!--content-->Actually, there may be a way (sortof). Is the data you're calling into the form field and page .cgi generated? If it is, does it have a input name? I may have a script I could adapt to your needs.<!--content-->Well, I haven't written the original script... but it's collecting it's info from textfiles on another server...<br />
<br />
I'm just modifying lines which looks like:<br />
<br />
print "<td>$error</td>";<br />
<br />
/Robert<!--content-->In IE5 there is a new style attribute "table-layout" which firmly set column widths.<br />
<table style="table-layout: fixed"><br />
<col width="20%"><col width="200px"><col width="30%">etc.<br />
<br />
[If there are no <col> tags then the browser looks at the first row to determine width]<br />
<br />
Specifying table-layout:fixed can significantly reduce loading time, as the browser doesn't have to read through the entire table to determine the maximum size of each column.<br />
More to the point, it will 'respect' the widths you specify. The downside is that it will clip any content that it can't wrap (content without whitespace).<!--content-->if you use the fixed layout for the table then overflow on the cells is also available <br />
<br />
<td style="overflow-x:hidden"><br />
or <br />
<td style="overflow-x:scroll"> <br />
<br />
might help.<!--content-->
 
Back
Top