Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6386139
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T02:59:12+00:00 2026-05-25T02:59:12+00:00

I am using a post template from within WordPress to create a table. However

  • 0

I am using a post template from within WordPress to create a table. However the formatting is a bit messed up.

The PHP that generates the code goes in and queries a server for the user’s test information for the day. It then trims down that internal report to get just the table. Note that the report does not close the </tbody> tag, so I had to use a str_replace to close that tag.

global $current_user;

get_currentuserinfo();

$raw_contents = file_get_contents('http://******/NamedRptRun.asp?Rpt=DailyUserSum&Prj=******_****UserId='.($current_user->user_login));

    $trim_raw = trim($raw_contents);
//echo htmlentities($trim_raw);

if ($trim_raw == 'No Records Returned')  {

    echo 'No test cases to report today.';

} else {

    $tag = '<TABLE';

    $topTrim_contents = stristr($raw_contents, $tag);

    $tag = '</BODY>';

    $table_only = stristr($topTrim_contents, $tag, TRUE);

    $table_only = str_replace("</tr></table>", "</tbody></tr></table>",$table_only);

   echo htmlentities($table_only);
   echo str_replace(array("\r\n","\n","\t"), ' ',$table_only);

}

This provides me with both code for the table (only for debugging purposes), as well as what should be the table. However, the values of the table are not actually within the table, but are shown on the line above the table.

<TABLE cellspacing=0 cellpadding=0 border=1 bordercolor=Silver>
<thead class=b>
<TR bgColor=WHITE>
<th>&nbsp;Engineer&nbsp;</th><th>&nbsp;Passed&nbsp;</th><th>&nbsp;PWWarn&nbsp;</th><th>&nbsp;Blocked&nbsp;</th><th>&nbsp;Failed&nbsp;</th><th>&nbsp;Total Run&nbsp;</th></tr></thead><tbody class=h><TR bgColor=#F1F1F1><TD nowrap>myname</td><TD nowrap>1</td><TD nowrap>0</td><TD nowrap>0</td><TD >0</td><TD nowrap>1</td></tbody></tr></table>

10001
 Engineer    Passed      PWWarn      Blocked     Failed      Total Run 
myname

Anyone have any suggestions as to why this might happen?

Pasting View-Page Source of the final table that was generated.

<table border="1" cellspacing="0" cellpadding="0">
    <thead class="b">
        <tr bgcolor="WHITE">
            <th> Engineer</th>
            <th> Passed</th>
            <th> PWWarn</th>
            <th> Blocked</th>
            <th> Failed</th>
            <th> Total Run</th>
        </tr>
    </thead>
    <tbody class="h">
        <tr bgcolor="#F1F1F1">
            <td nowrap="nowrap">myname</td>
        </tr>
    </tbody>
</table>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T02:59:12+00:00Added an answer on May 25, 2026 at 2:59 am

    Solution was found after contacting the author of SimplePostTemplate. It seems as if wordpress will filter out bad HTML, which is exactly what it did with my table, and thus why it didn’t show properly.

    I was able to ask the other department to clean up their html before it got to wordpress, and thus passing the filters and solving the issue.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

when using http post with flash that send ip address request from client computer
I'm using WP Alchemy to create a meta box in a post that allows
Edited Post These are the new functions that I have created using your template
In my application am submiting my form by using post for a php page.
I'm using $().post and php to change the contents of a <textarea>. The script
How do i paginate this? It's a code in wordpress template I'm using to
I've done jQuery post successfully. However, in order to get the data returned from
Using the below code, my template loads fine until I submit the from, then
Am using php to develop an app and i created a simple template system
Long story short, I'm using a buggy WordPress template and we're too far into

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.