I have been making my own little forum for my website, but if someone enters something long without any spaces in such as a long url then the html table it is in stretches which can distort the layout. How can i stop it from doing this?
The CSS overflow: hidden property can take care of that, but it won't wrap the long word. It'll just cut it off.
As LadyNRed told you, there really isn't an answer. They're going to stretch if the content is too wide no matter what you do.
You could write a built-in function that will split a term that is too long after X pixels without a space, but that will only work in some cases...users with their font sizes cranked high in their browsers (few and far between as they are) will still be stretched out.
Yeah, that's just how table cells behave. I think the overflow property is going to be the best solution though you might want to use overflow: auto or overflow: scroll to allow the full url to be seen with a little scrolling.
Unfortunately I don't think you can use overflow on a table or table cell so you would need to include a div inside of each cell that wraps around the text. You can apply the overflow property to that div.
__________________ l Search Engine Friendly Web Design | Please login or register to view this content. Registration is FREE
l Tips On Marketing, SEO, Design, and Development | Please login or register to view this content. Registration is FREE