SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Member
    Join Date
    May 2002
    Posts
    6
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Text not wrapping in a table..

    I am completely confused...
    I have a table with two rows...one row with a picture.....the next row with a description.

    I use PHP to place the pictures AND the description like this:
    Code:
      <table border=0 align="center" cellspacing=0 cellpadding=0><tr><td>
       <IMG SRC=<? print "$image"; ?>  BORDER="0"></td></tr>
       <tr><td class="caption"><? print "$desc"; ?></td></tr>
       </table>
    In my sstyle sheet the caption class is this
    Code:
    .caption
    {
    	color: #000000;
    	font-size: 10pt;
    	font-family: Verdana;
    	background-color: #cccccc;
    	border: 1px solid #000000;
    	border-width: 0px 1px 1px 1px;
    }
    the text goes far beyond the picture making it look all off!

    Here is the link:

    http://www.4gigs.com/~webhead/images...age=063002.jpg

    How do I fix this problem?

  2. #2
    My precious!!! astericks's Avatar
    Join Date
    Mar 2002
    Location
    Vancouver, BC
    Posts
    1,971
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Text not wrapping in a table..

    Originally posted by wdhead
    Here is the link:

    http://www.4gigs.com/~webhead/images...age=063002.jpg
    Link not working for me. Fix it plz.

  3. #3
    morphine for a wooden leg randem's Avatar
    Join Date
    Jun 2002
    Location
    .chicago.il.us
    Posts
    957
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If you don't set a defined width on the table, it will grow dynamically to fit its contents.

    This is further compounded by the fact that you don't even have <p> tags around your caption.

    The quick and easy answer is to set a width attribute on the table, but I recommend adding the <p> tags as well.

  4. #4
    SitePoint Member
    Join Date
    May 2002
    Posts
    6
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Sorry I have been changing things around


    This is the new link

    http://www.4gigs.com/~webhead/images...age=063002.jpg



    Also, I cna't make it a fixed width table because all of the images are not the same size. I have never encountered text making the table wider before like this. Is using <p> tags inside a table really necessary?

  5. #5
    morphine for a wooden leg randem's Avatar
    Join Date
    Jun 2002
    Location
    .chicago.il.us
    Posts
    957
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by wdhead
    Is using <p> tags inside a table really necessary?
    Paragraph (<p>) tags encourage text wrapping.

    Also, an image will force a fixed-width table to expand around it, but the text will not. If your images are of varying sizes, set the table's fixed width to the width of the smallest picture.

  6. #6
    SitePoint Member
    Join Date
    May 2002
    Posts
    6
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Exactly.....an image will make it expand but that IS NOT what is happening.....the test is making it expand. Did you look at it?

    http://www.4gigs.com/~webhead/images...age=063002.jpg

    If I insert a <p> tag it would take on a different style class.....but I may do that......its just strange that the text is what is making the table expand.....never had that happen.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •