CSS line break in TD

If I have a very long line (no spaces!). Can I make the browser interrupt it, for example, in a table tdvia CSS. Width has no effect.

Note. I know that it is very unlikely that anyone would submit a long string without spaces, but you never know ...

I tried:

.gridrow td
{
    padding: 1em;
    text-align: center;
    word-wrap: break-word; 
}

and I use FF as my browser. word-wraponly used in CSS3?

+3
source share
3 answers

I think you mean CSS:

#id
{
  max-width: 100px; /*or whatever*/
  word-wrap: break-word;
}

Tested on your Firebug site, it works.

Link to the article .

+6
source

- . , , - ; overflow: hidden . :

  • . (: http://www.quirksmode.org/oddsandends/wbr.html) &shy; <wbr> , .

  • , , , :

    table {
        table-layout: fixed;
        width: 100%;
    }
    
    table td {
        word-wrap: break-word;         /* All browsers since IE 5.5+ */
        overflow-wrap: break-word;     /* Renamed property in CSS3 draft spec */
    }
    
+4

, wordwrap. .

word-wrap: break

REF Word-wrap html

, .

0

Source: https://habr.com/ru/post/1747349/


All Articles