Thursday, 12 November 2015

html, a sentence or a paragraph auto new line.


in html, it is auto new line by default.

for example, in your table, if you don't want auto new line, you want a whole sentence show on a single line. you can:

td {
    white-space: nowrap;
}


if you want it auto new line again you can:

.td-wrap {
    white-space: pre-wrap;
}

or

.td-wrap {
    white-space: normal;
}




http://www.w3schools.com/cssref/pr_text_white-space.asp





No comments:

Post a comment