HTML表格中的`iframe`

I am displaying some data from a database into my cms, using tables (tr, td).

   <tr align="center">
        <td><?php echo $i++; ?></td>
        <td><?php echo $post_image; ?></td>
        <td><?php echo $post_title; ?></td>
        <td>
            <iframe width="100px" frameborder="0" id='inneriframe' scrolling=yes >
                <?php echo $post_description; ?>
            </iframe>
        </td>
        <td><a href="index.php?edit_football_news=<?php echo $post_id; ?>">Edit</a></td>
        <td><a href="includes/delete_football_news.php?delete_football_news=<?php echo $post_id; ?>">Delete</a></td>
    </tr>

Unfortunately the description php variable is not displayed at all inside my iframe. However, if I take out the iframe tag, everything works fine, and I can see all the stored values from the database.

<tr align="center">
        <td><?php echo $i++; ?></td>
        <td><?php echo $post_image; ?></td>
        <td><?php echo $post_title; ?></td>
        <td><?php echo $post_description; ?></td>

        <td><a href="index.php?edit_football_news=<?php echo $post_id; ?>">Edit</a></td>
        <td><a href="includes/delete_football_news.php?delete_football_news=<?php echo $post_id; ?>">Delete</a></td>
    </tr>

So my main question is how to use iframes inside tds?

iframe elements load external documents; the HTML that goes between their start and end tags is alternative content for browsers which do not support iframes.

If you want a scrolling area on a page, apply the CSS overflow property to an appropriate element (probably a div in this case).

As I mentioned in comments (but gotten no response from).

Taken from example #1:

<iframe src="page.html" width="400" height="300">
   <p>Your browser does not support iframes.</p>
</iframe>

What you need to do is to remove the <?php echo $post_description; ?> from the iframe and just do:

<iframe src="file_for_iframe.php" width="100px" frameborder="0" id='inneriframe' scrolling=yes >

</iframe>

and have the variables inside file_for_iframe.php to be echo'd in there.

That's how you'll get your iframe to show the contents "on screen" rather than in HTML source.

If you had a look at your HTML source as I also mentioned in comments, you would indeed have seen the contents.

They're in there alright, but not being echo'd properly (on screen).

The (and as an example) file_for_iframe.php file that I have stated above, will contain whatever content you wish to display.

For example:

<?php 

echo $post_description = "Whatever is presently assigned to this...";

?>

Important note:

echo $post_description = "x"; is valid syntax and you need to keep the echo for it. Otherwise, it won't work.