Glese Posted December 1, 2011 Share Posted December 1, 2011 This is the CSS of a table. The table holds text data which is an user contribution. table.character_artwork_table { clear: both; border: 1px solid #e2e2e2; min-width: 600px; max-width: 750px; empty-cells: show; margin: 2em 0 2em 0em; } table.character_artwork_table td { border: 1px dashed lightgrey; padding: 0 0 0 0.2em; } /* Contribution Area */ table.character_artwork_table tr:last-child > td { padding: 2em 0 2em 2em; font-family: verdana; font-size: 12pt; letter-spacing: 0; line-height: 1; } /* Description Area */ table.character_artwork_table tr:nth-last-child(3) p { padding: 1em 0 1em 0; word-wrap: break-word; } table.character_artwork_table tr:first-child, table.character_artwork_table tr:nth-child(2), table.character_artwork_table tr:nth-child(3) { background-color: #f9f9f9; } table.character_artwork_table tr:nth-last-child(2) { background-color: #f9f9f9; } table.character_artwork_table tr td:first-child img { margin: 5px -20px -40px 5px; } I think I did use the word-wrap in the right way, though I seem to have not, otherwise it would work. Let me explain, the table itself has a maximum width of 750px as you can see in the first block at the top, I am using the word warp property in the description area of the table, and when an entry like for example a continuous string has been done, which breaks the boundaries of the table and stretches the table further than the maximum width than I would like to have the continuous string to be broken BY the maximum width. I also used the break-word attribute, which is supposed to break words which are normally unbreakable. So far, so good, so far I tried to use this property the way I understood it from the description on W3C here: http://www.w3schools.com/cssref/css3_pr_word-wrap.asp Though why does now a continuous string entry like "blaaaaaaaaaaaaaaaaaaaa" not get broken, for me, in my script? And that exactly describes my question. Even though I used everything the way I understood from the documentation this long word still does not get broken. Any suggestions? Link to comment https://forums.phpfreaks.com/topic/252241-trying-to-get-word-wrap-working/ Share on other sites More sharing options...
Glese Posted December 3, 2011 Author Share Posted December 3, 2011 I got it working, it only seems to work with a div. Link to comment https://forums.phpfreaks.com/topic/252241-trying-to-get-word-wrap-working/#findComment-1293831 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.