0

One of my sites is a YouTube search engine. It has a main table with a width of 750 that works normally until the text accompanying a video in a below table is a single word longer than 48 characters (which usually happens in some really long URL), then the entire main table expands to 793 and it looks weird because the logo image at the top remains at 750 pixels (the footer at the bottom also looks funky when this happens).

Is there any way to force this table to remain at 750 no matter what the length of some long word or URL in a table below it?

Siguza
  • 21,155
  • 6
  • 52
  • 89
  • What do you want to happenm to the too-long word? Truncation, hyphenation, etc? – Mr Lister Jun 26 '16 at 20:27
  • 2
    Also, you should post a snippet that demonstrates the issue. – Mr Lister Jun 26 '16 at 20:28
  • `white-space: break-word`, perhaps? – godfrzero Jun 26 '16 at 20:29
  • I guess truncation would be OK, it doesn't really matter to me as long as the table width isn't messed up. I tried to post a snippet, but it didn't work and I thought maybe it wasn't allowed. – super70s Jun 26 '16 at 20:33
  • godfrzero: where would I insert the "white-space: break-word," in the "table width=750 border="0" align=center cellpadding=5 cellspacing=0", or somewhere in the CSS? – super70s Jun 26 '16 at 20:35
  • 1
    It'd be on whatever is wrapping the text. Ideally, I'd need a snippet to hammer out a proper answer :D – godfrzero Jun 26 '16 at 20:37
  • *I tried to post a snippet, but it didn't work and I thought maybe it wasn't allowed.* It's allowed. Create a demo using any or all of the following services: [jsFiddle.net](https://jsfiddle.net/), [CodePen.io](https://codepen.io/), [Plunker.co](http://plnkr.co/), [JS Bin](https://jsbin.com/) or a snippet (7th icon located on the text editor toolbar or CTRL+M). – zer00ne Jun 26 '16 at 21:18
  • I looked at the example, my situation is I have a vertical column of tags and ads on the left, then a column on the right with the videos and descriptions. I inserted "table-layout: fixed...", etc., into the css and that really messed things up, lol. Also, I tried inserting "td word-break: break-word" like someone else suggested, and that didn't do anything. Here is my css if anyone wants to look at it: https://jsfiddle.net/super70s/yzxomyoq/ – super70s Jun 26 '16 at 22:03
  • I think I got it guys! I inserted... {description} ...into a file called list_by_tag.html That works, at least in Firefox. http://stackoverflow.com/questions/1258416/word-wrap-in-an-html-table?rq=1 – super70s Jun 26 '16 at 22:32

0 Answers0