Jump to content

pasting a table in html code into a field


tpfp

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
Link to comment
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...
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

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.