Swarfega Posted December 29, 2012 Share Posted December 29, 2012 Hi. I've got another issue. Basically, I'm using a while loop to drag all the Data from the database to display on a page. Consider it a 'Guestbook', if you will, except for all users. (Chat) The problem is that I can't find any legit way using <td> tag-attributes to lock the Message in its place (I have this issue on the normal GuestBook invidiual for each user as well). I'm better of just showing you what I'm talking about: http://i49.tinypic.com/qoyd8l.png I want the <td> Tag to display the whole message, but once it reaches the drawn-Red line, I want it to make a new line and keep the message flowing like that until the message has been fully printed. I've tried the following: - <td width='xx'> Tag - <td class='xx' width='xx'> Tag (CSS) And nothing thus far has worked out. Any suggestions what to do to lock it in place? Quote Link to comment https://forums.phpfreaks.com/topic/272468-tag-issue/ Share on other sites More sharing options...
Swarfega Posted December 29, 2012 Author Share Posted December 29, 2012 <td style='max-width: 600px; overflow:auto; word-wrap:break-word;'> Fixed the issue by doing this, if someone else encounters this. Quote Link to comment https://forums.phpfreaks.com/topic/272468-tag-issue/#findComment-1401938 Share on other sites More sharing options...
Christian F. Posted December 29, 2012 Share Posted December 29, 2012 (edited) The better way would have been to use the proper HTML tags for this, as a guestbook isn't tabular data. This is quite easily done with a div-block, and a bit of CSS: <div class="post"> <img class="avatar" src="avatar.png"> <h3>{$Name}</h3> <h4>{$Date}</h4> <p>{$Post}</p> </div> With that HTML you'll only need the following CSS: div.post { width: 600px; } div.post:after { content: "."; height: 0px; display: block; visibility: hidden; clear: left; } div.post img { float: left; } div.post h3 { display: inline; } div.post h4 { display: inline; } div.post h4:before { content: " - "; } Not tested, but should work. Edited December 29, 2012 by Christian F. Quote Link to comment https://forums.phpfreaks.com/topic/272468-tag-issue/#findComment-1402011 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.