HTML question (yeah yeah I know..)

  • Thread starter Thread starter John Wood
  • Start date Start date
J

John Wood

I can't find an HTML newsgroup that's at all active! Thought I'd ask here
anyway...

I've noticed that a table cell width is ignored if the content contains
words that (themselves) are wider than the specified width. The table just
grows width-wise.

Is there any way to stop this?

I'm trying to get my tables to fit 640px wide, but the content frequently
makes them bleed off the page.

TIA,
John
 
Well I do that, but if one of the cells contains a word that it cannot break
up (eg. let's say a 30 digit number) then the cell resizes beyond its
specified width. Can't seem to figure out how to stop it...

eg.
<table width=100 border=1>
<tr>
<td>this is 100 pixels<td>
</tr>
</table>

<table width=100 border=1>
<tr>
<td>this is not !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!<td>
</tr>
</table>
 
Hi John,

AFAIK that is not possible, you could try using javascript to format the
cell after the page is loaded and rended, other than that I cannot think of
a better idea.


Cheers,
pd:
if you find the answer post it back here
 
Aha, figured it out.
Seems that you can use the DIV tag with overflow set to hidden to do it...
Cool huh?

<table width=100 border=1>
<tr>
<td><div style="width: 100px; overflow: hidden"> this is not
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!</div><td>
</tr>
</table>
 
Back
Top