table expanding too much

Associate
Joined
18 Oct 2002
Posts
858
Location
Cheshire
ok, I'm making my own 'live chat' system using php and mysql...
one frame displays the messages (max of 20) except, their a max of 250 charecters in each message which flows off the right hand side.
Is their an easy way to get it to auto matically 'word wrap' to the next line within a table cell rarther than extending the table off the screen?

Thanks
 
define a width for the cell using css. Give the cell with the message in a class, and then use css to restrict the width of that class

Code:
table td.<your class name> {width:200px}

then all the text should just wrap onto the next line

you should also probably give the other cells in the row a meaningful class name, and restrict their width also, however then you will have a fixed table size. if you want the table to be flexible, try this

Code:
table {width:100%}
table td.<your class name> {width:100px}
table td.<another class name> {width:120px}
table td.<your message class> {width:auto}

then the cell with the message in will expand and contract depending on the width of the table, which in itself will expand and contract depending on the size of whatever it is contained in
 
the table does need to expand upto the the size of the curent window... so, on my screen it will have plenty of space.... but on joe publics they might only be running 1024X768....or less

I'll try the above....
 
Back
Top Bottom