Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

stopping table cell from expanding ???

Status
Not open for further replies.

BobbaFet

Programmer
Feb 25, 2001
903
NL
Hi all,

How can I make a table cell stop automatically expanding when the text becomes too large for the cell ???

Thanx allot,
BobbaFet

Everyone has a right to my opinion.
E-mail me at caswegkamp@hotmail.com
 
Simply declare a set width for the cell width="50"

<table border='2' cellpadding='0' cellspacing='0' width='400'>
<tr>
<td width='100'>
This is some text to test the length of the cell after putting in this much text. Does it hold it's width and wrap down like it's supposed to, or does it keep growing?
</td>
<td width='300'>
Some Filler Text
</td>
</tr>
</table>


Hope this helps. -Ovatvvon :-Q
 
Thanx for your response Ovatvvon,

I set my width you percentages, 1 table is 33% wide and
that stays that way, but in the cells are hyperlinks and when the mouse goes over them they turn go uppercase.
This causes some cells to vertically expand. I want to stop
that. The only question is how.
BobbaFet

Everyone has a right to my opinion.
E-mail me at caswegkamp@hotmail.com
 
Have you set the percentages (or a static width) for all cell's across the table, or only just the first cell leaving the other cells undefined? If you haven't, try defining all the columns across and see how that works. -Ovatvvon :-Q
 
they are all defined. Maybe I should imply a fixed height
too? Could that solve it ??? BobbaFet

Everyone has a right to my opinion.
E-mail me at caswegkamp@hotmail.com

&quot;<beer brand> is like making love in a cano...
it's <f-word + ing> close to water !!!&quot;
- Monty Python's Flying Circus, 1969/70
 
have you tried putting a 'dummy' row/column in your table consisting of spacer images?

if you size your images so they are slightly bigger than the contents of your cell, the cells shouldn't be affected by the size of their content.

just put an extra row at the bottom of your table like this...

<tr>
<td><img src=&quot;spacer.gif&quot; width=&quot;100&quot; height=&quot;0&quot;></td>
<td><img src=&quot;spacer.gif&quot; width=&quot;100&quot; height=&quot;0&quot;></td>
<td><img src=&quot;spacer.gif&quot; width=&quot;100&quot; height=&quot;0&quot;></td>
<td><img src=&quot;spacer.gif&quot; width=&quot;100&quot; height=&quot;0&quot;></td>
</tr>

...and do somehting similar for a spacer column to fix the heights

hope this helps

ss
 
Have you tried a &quot;nowrap&quot; parameter?

<td nowrap=&quot;true&quot; width=&quot;130&quot;>

Should make it so it doesn't affect the end of the cell, but then could disappear behind it.
-Ovatvvon :-Q
 
He Bobbafet,

If you don't mind it won't work in NN4.7 (I don't know about NN6), you can use this. It works perfectly in IE:

<td width=150 rowspan=3 height=90>
<div style=&quot;width:150px; height:90px; overflow:hidden&quot;>
Text1Text2 Text1Text2Text3Text4Text5Text6Text7 Text1Text2Text3Text4 Text1Text2Text3Text4Text5Text6Text7 Text1Text2 Text1Text2Text3 Text1Text2Text3Text4 Text1Text2Text3Text4Text5 Text1Text2Text3Text4Text5Text6
</div>
</td>

Try also overflow:scroll for the possibility to read the complete text.

Hope this helps,
Erik <!-- My sport: Boomerang throwing !!
This year I will participate at the World Championships in Germany. (!! Many Happy Returns !! -->
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top