my problem is in sizing the td i've created a table <table width="400" border="1"> <tr> <td valign="top">dkmd</td> <td> </td> </tr> <tr> <td width="200">eeeeeeeeeeeefffffffffffffffffffffffffffffffffffffffffffffffffffffffeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeedddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd</td> <td> </td> </tr> </table> Code (markup): If i've defined a <table width="400" border="1"> <tr> <td valign="top">dkmd</td> <td> </td> </tr> <tr> <td width="200">eeeeeeeeeeeefffffffffffffffffffffffffffffffffffffffffffffffffffffffeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeedddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd</td> <td> </td> </tr> </table> HTML: I want that cell don't expand and it remain 200px even if I've to lose the word Coul anyone help me? thanks
Well why don't you try editing it with CSS? I'm not sure exactly where your problem lies, but you could make a rule targeting either every single <td>, or give it a class and do it that way, and then set the width, min-width, and max-width to 200px. If you don't understand css, try giving the other <td> a set with to split the difference, or give all of the <tr>'s specific widths.
OK, try this: <style type="text/css"> <!-- .overflow { overflow: hidden; width: 200px; } --> </style> <body> <table width="400" border="1"> <tr> <td valign="top">dkmd</td> <td> </td> </tr> <tr> <td width="200"><div class="overflow">eeeeeeeeeeee - I shortened this just for the display here - add your content fully</div></td> <td> </td> </tr> </table> </body>
or start to use divs, easier to understand, I could never understand tables and plus if you want semantically correct code depending if you are putting tubular data in that table or not then divs are the right choice.
<table style=word-break:break-all CELLSPACING=0 CELLPADDING=0 WIDTH=180 align=center><tr><td VALIGN=top >1</td></tr></table>
There is nothing wrong with using tables or tables and divs or just divs to make a site. Show me a site held together entirely with divs and I'll show you a site which more than likely doesn't behave really good in some browsers. It's all very good to preach about divs, but only very skilled coders can solve all the CSS issues to be sure it will hold together properly in most browsers. Pages coded to standards will validate whether they use tables or not. Use the tools that are right for the job.
thanks for the answer but the problem persist. the problem is the unique word fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff Code (markup): with many character and no space couse If I've ffffffffffffffffffffffffffffffffffffff fffffffffffffffffffffffffffffffffffffffffff fffffffffffffffffffffffffffffffffffff fffffffffffffff Code (markup): with spaces there are no problem I've read somewhere the solution is to use the word-break suggested by ricer but It's supported only by IE. I've to wait the CSS3 to implement anyway for the future use of the post i believe it's a useful lik to problem http://www.w3.org/TR/css3-text/#word-break http://www.w3.org/TR/css3-text/#word-break If anyone knows more thanks
lapoo, did you try my solution as shown above? The table with the DIV in it as shown above does work. No matter how long the single word (no spaces) is, the TD is wrapped at 200 px.
<style type="text/css"> <!-- .overflow { overflow: hidden; width: 200px; } --> </style> <body> <table width="400" border="1"> <tr> <td valign="top">dkmd</td> <td> </td> </tr> <tr> <td width="200"><div class="overflow">----- I shortened this just for the display here - add your content fully</div></td> <td> </td> </tr> </table> </body>