ds111 Posted December 6, 2008 Share Posted December 6, 2008 Hi! I have a question. In a table, I'm echoing some text from a database. How can i make it so that only the text that fits in that <td> is shown? Meaning it doesnt extend the td? Thanks! Quote Link to comment Share on other sites More sharing options...
ds111 Posted December 7, 2008 Author Share Posted December 7, 2008 if anyone wants simplified code (w/o PHP), here it is: <table cellspacing="0" cellpadding="0" border="1"> <tr> <td width:100px><div>1234567890123456</div></td> <td width:100px><div>1234567890123456</div></td> </tr> <tr> <td width:100px><div>a</div></td> <td width:100px><div>b</div></td> </tr> <tr> <td width:30px><div style="nowrap;overflow:scroll">WWWWWWWWWWWWWWW2</div></td> <td width:100px><div>b</div></td> </tr> </table> I want Column 1 and Column 2 to be the same size of 100px, and so that WWWWWWWW...2 should be cut to fit in. Quote Link to comment Share on other sites More sharing options...
sstangle73 Posted December 7, 2008 Share Posted December 7, 2008 style="overflow:none;" should do it. i cant really think straight tho so let me know if it doesnt Quote Link to comment Share on other sites More sharing options...
ds111 Posted December 7, 2008 Author Share Posted December 7, 2008 No, that doesn't work. Quote Link to comment Share on other sites More sharing options...
ds111 Posted December 7, 2008 Author Share Posted December 7, 2008 Anyone else know? Quote Link to comment Share on other sites More sharing options...
sstangle73 Posted December 7, 2008 Share Posted December 7, 2008 here you go <table cellspacing="0" cellpadding="0" border="1"> <tr> <td style="width:100px;"><div>a</div></td> <td style="width:100px;"><div>b</div></td> </tr> <tr> <td style="width:100px;"><div>a</div></td> <td style="width:100px;"><div>b</div></td> </tr> <tr> <td style="max-width:100px;overflow:hidden;"><div>abcdefghijklmnopqrstuvwxyz</div></td> <td style="width:100px;"><div>b</div></td> </tr> </table> that will work i had the right idea like i said my head was in a grog yesterday Quote Link to comment Share on other sites More sharing options...
adx Posted December 7, 2008 Share Posted December 7, 2008 alternately you could switch to div's that don't stretch no matter what. Quote Link to comment Share on other sites More sharing options...
phpSensei Posted December 10, 2008 Share Posted December 10, 2008 use this in your CSS, and change the paremeters as you like <style type="text/css"> <!-- div.scroll { height: 200px; width: 300px; overflow: auto; border: 1px solid #666; background-color: #ccc; padding: 8px; } --> </style> Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.