Jump to content


<Td> Tag Issue

  • Please log in to reply
2 replies to this topic

#1 Swarfega

  • Members
  • PipPipPip
  • Advanced Member
  • 38 posts

Posted 29 December 2012 - 01:09 AM


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:


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?

#2 Swarfega

  • Members
  • PipPipPip
  • Advanced Member
  • 38 posts

Posted 29 December 2012 - 01:17 AM

<td style='max-width: 600px; overflow:auto; word-wrap:break-word;'>

Fixed the issue by doing this, if someone else encounters this.

#3 Christian F.

Christian F.
  • Staff Alumni
  • Advanced Member
  • 3,106 posts
  • LocationNorway

Posted 29 December 2012 - 01:55 PM

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">

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 by Christian F., 29 December 2012 - 01:56 PM.

Keeping it simple.

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users