Board index   FAQ   Search  
Register  Login
Board index php forum :: php coding PHP coding => General

Trouble with table elements

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

Trouble with table elements

Postby nbasso713 » Wed Dec 26, 2012 5:47 pm

I'm not quite sure what I'm missing, but for some reason the last two close tags "</td>, </tr>" are not closing the second column and first row respectively.

Any help would be greatly appreciated.

Here's the PHP:

Code: Select all
echo '   <tr width="500">
        <td width="200"> <img src="'.$item[2].'"/></td>
    <td width="300">
        <tr>
            <td width="150">Picture Name</td><td width="150">'.$item[1].'</td>
        </tr>
        <tr>
            <td width="150">Tag</td><td width="150">'.$item[4].'</td>
        </tr>
        <tr>
            <td width="150">Category</td><td width="150">'.$item[3].'</td>
        </tr>
        <tr>
            <td width="150">ID</td><td width="150">'.$item[0].'</td>
        </tr>
        <tr>
            <td width="150">User ID</td><td width="150">'.$item[5].'</td>
        </tr>
        <tr>
            <td width="150">IP</td><td width="150">'.$item[6].'</td>
        </tr>
        <tr>
            <td width="150">Timestamp</td><td width="150">'.$item[7].'</td>
        </tr>
    </td>
</tr>';


Here's the html output from the browser source:

Code: Select all
<tr width="500">
        <td width="200"> <img src="pending/test.jpg"/></td>
    <td width="300">
        <tr>
            <td width="150">Picture Name</td><td width="150">2.gif</td>
        </tr>
        <tr>
            <td width="150">Tag</td><td width="150">random funny picture</td>
        </tr>
        <tr>
            <td width="150">Category</td><td width="150">Random</td>
        </tr>
        <tr>
            <td width="150">ID</td><td width="150">2</td>
        </tr>
        <tr>
            <td width="150">User ID</td><td width="150">0</td>
        </tr>
        <tr>
            <td width="150">IP</td><td width="150">127.0.0.1</td>
        </tr>
        <tr>
            <td width="150">Timestamp</td><td width="150">2012-12-25 02:10:29</td>
        </tr>
    </td>
</tr>
nbasso713
New php-forum User
New php-forum User
 
Posts: 15
Joined: Sat Dec 10, 2011 4:00 pm

Re: Trouble with table elements

Postby nbasso713 » Wed Dec 26, 2012 7:16 pm

SOLVED

Changed first row in second column to a new table.
nbasso713
New php-forum User
New php-forum User
 
Posts: 15
Joined: Sat Dec 10, 2011 4:00 pm


Return to PHP coding => General

Who is online

Users browsing this forum: No registered users and 4 guests

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.