0

I have a long string of a file path that has no spaces. For example:

This is displayed in a table, something like:

<td>
    /thisisthetopfolder/thisisthebottomfolder/thisisthefile.html
</td>

However, the text does not overflow onto the next line, it is just chopped off/truncated at the end of the table cell's width. I cannot increase the table or table cell's width. Is there a way to force-overflow the text in a table cell so it doesn't cut off?

It looks like this:

------------------------------------------
| /thisisthetopfolder/thisi | other info  |
------------------------------------------

And it needs to look like this:

------------------------------------------
| /thisisthetopfolder/thisi  |            |
|  sthebottomfolder/thisisth |            |
|  efile.html                | other info |
------------------------------------------
1
  • Have you played with the overflow property? Commented Apr 12, 2013 at 19:33

1 Answer 1

2

Add this CSS rule:

td {
    word-break:break-word;
}

jsFiddle example

The word-break CSS property is used to specify how (or if) to break lines within words.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.