html5, CSS

CSS <table> <td> wrap

F.xavier 2018. 6. 8. 21:12

CSS style에서는 Table Size를 고정하기 위해 NoWrap을 사용하지만 부분적으로 Wrap 필요한 경우에 사용하는 것이 


CSS white-space Property


Example

Demonstrate different values of the white-space property:

p.a {
    white-space: nowrap;
}

p.b {
    white-space: normal;
}

p.c {
    white-space: pre;
}
Try it Yourself »

CSS Syntax

white-space: normal|nowrap|pre|pre-line|pre-wrap|initial|inherit;

Property Values

ValueDescriptionPlay it
normalSequences of whitespace will collapse into a single whitespace. Text will wrap when necessary. This is defaultPlay it »
nowrapSequences of whitespace will collapse into a single whitespace. Text will never wrap to the next line. The text continues on the same line until a <br> tag is encounteredPlay it »
preWhitespace is preserved by the browser. Text will only wrap on line breaks. Acts like the <pre> tag in HTMLPlay it »
pre-lineSequences of whitespace will collapse into a single whitespace. Text will wrap when necessary, and on line breaksPlay it »
pre-wrapWhitespace is preserved by the browser. Text will wrap when necessary, and on line breaksPlay it »
initialSets this property to its default value. Read about initialPlay it »
inheritInherits this property from its parent element. Read about inherit