1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

Why is this table not laying out right?

Discussion in 'Web Design & Development' started by BlackFrancis, Jan 7, 2013.

Thread Status:
Not open for further replies.
Advertisement
  1. BlackFrancis

    BlackFrancis Thread Starter

    Joined:
    Oct 21, 2006
    Messages:
    223
    Hi. I'm fiddling around with the output of this software (Wordpress plugin, "Buddypress Activity Plus"), which itself doesn't matter because the issue is between HTML and PHP.

    This is what I'm trying to do:

    PHP:
    <table width="858" border="0">
      <tr>
        <td colspan="2">
                <a href="<?php echo $url;?>"><?php echo $title;?></a>
    </td>
      </tr>
      <tr>
        <td width="252"><?php if ($image) { ?>
            <a href="<?php echo $url;?>"><img src="<?php echo $image?>" /></a>
        <?php ?>
    </td>
        <td><?php echo $body;?>
    </td>
      </tr>
    </table>
    The intended outcome being:

    What I get:

    [​IMG]

    The content comes out in 3 rows. Never had HTML do this to me.
     
  2. mobo

    mobo

    Joined:
    Feb 23, 2003
    Messages:
    16,274
    You could try this:

    Code:
    <table width="858" border="0">
      <tr>
        <td colspan="2">
                <a href="<?php echo $url;?>"><?php echo $title;?></a>
        </td>
     </tr>
      <tr colspan="2">
        <td width="252"><?php if ($image) { ?>
           <a href="<?php echo $url;?>"><img src="<?php echo $image; ?>" /></a>
        <?php } ?>
        </td>
        <td>ddd<?php echo $body;?>
        </td>
     </tr>
    </table>
     
  3. BlackFrancis

    BlackFrancis Thread Starter

    Joined:
    Oct 21, 2006
    Messages:
    223
    The only thing that changed was the "ddd" that you included before the link description echo.

    I'm looking it over on Chrome/Iron's inspect tool, and according to the source it's showing up as <p> and <div> tags?!

    Why might this be?
     
  4. mobo

    mobo

    Joined:
    Feb 23, 2003
    Messages:
    16,274
    I did leave the ddd in by mistake but there was one other change in the code from your code.
     
  5. BlackFrancis

    BlackFrancis Thread Starter

    Joined:
    Oct 21, 2006
    Messages:
    223
    Well it appears to me that there is something in the CSS, perhaps, of the software that is stripping tables and replacing with paragraphs and divs.

    Do you know what might be capable of doing that? This is a vast piece of software, I need to find a clue.
     
  6. Sponsor

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Loading...
Similar Threads - table laying right
  1. mosassas
    Replies:
    2
    Views:
    649
Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/1084200

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice