Line break inside a table cell

Asked

Viewed 2,085 times

1

I have a common table in my HTML, but when a <td> has a great content line breaking does not happen, even adding CSS:

table td, th {
   padding: 5px;
   white-space: pre-wrap;
}

2 answers

1


It has a word-wrap and a white-space in its code, being that the white-space nowrap that comes after does not let the text break, with that its text does not break it is the text-overflow

  • I get it. I got what I wanted, I used a div inside a td, but the whole problem was in a library I’m using to convert HTML to PDF :/

  • @Gabrielbitti understood, I think it is this API of this HTML converter to PDF. Good I take this to give you a hint... If my reply has helped you in any way consider marking it as Accept, on this icon below the little arrows on the left side of the answer you think helped solve the problem. So the site does not get its open question pending no answer accepted even though it has already been resolved. []s

0

I had a problem with breaking lines and I managed to solve with this only this style below:

white-space: pre-wrap;

Browser other questions tagged

You are not signed in. Login or sign up in order to post.