Jump to content

Archived

This topic is now archived and is closed to further replies.

tpfp

pasting a table in html code into a field

Recommended Posts

is there a way to pasting a table in html code into a field on a form then submit it to a database and display the entry as a table.

etc if i paste this into a field called info.

<table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%">
  <tr>
    <td width="33%">name</td>
    <td width="33%">surname</td>
    <td width="34%">age</td>
  </tr>
  <tr>
    <td width="33%">billy</td>
    <td width="33%">gates</td>
    <td width="34%">54</td>
  </tr>
</table>

how would i then display it as a table instead of the code.
this is how i currently display and convert text

    $info = nl2br(stripslashes($row['info']));

sorry for the poor description of what i need to do

Share this post


Link to post
Share on other sites
yes - just post it directly into a query - use addslashes if magic quotes are off!!!

Share this post


Link to post
Share on other sites
Yeah i tried that but what happens is the table drops down for some reason half way down where its supposed to be.
is this a formatting problem ?.

[img]http://i51.photobucket.com/albums/f398/gilesp70/spare/table.jpg[/img]

Share this post


Link to post
Share on other sites
this looks more like poorly formed html - have a look at your source and see if there is an unclosed tag or something like... if the html you posted into the database is echoing out correctly then it is something to do with the parent elements

It could also be your styles if you have any...

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.