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

  • Home
  • SEARCH
  • 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 8838269
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T09:56:53+00:00 2026-06-14T09:56:53+00:00

A table is not rendering correctly while I’m trying to retrieve data from a

  • 0

A table is not rendering correctly while I’m trying to retrieve data from a MySQL table. Basically, I use an if statement to see if anything exists (if the user has posted information) and if they have I go to the else condition which displays the data in an HTML table. Here’s the code I’ve started with for the else statement.

else{
//BEGIN JOB POSTING
echo "<table border=1 width=200 height=200>";
while($row_job = mysqli_fetch_array($result_job))
{
echo "<tr>".$row_job['subject']."</tr>";
}
mysqli_free_result($result_job);
echo "</table>";
}

The reason I put the width and height and border is so you can see where the table is rendering and where the actual information is rendering. The information is being displayed, it’s just being displayed side by side with no spaces and not in a <tr>. Here’s a screenshot:

Data not rendering in table

The crazy thing is that if you check the source code of this page it looks like this:

<table border=1 width=200 height=200><tr>twkjljl</tr><tr>lkjljl</tr></table>

But if you inspect the element in Google Chrome, it looks like this:

Inspected Element

So I tried a couple things are I changed the code to have them display in <td> and it renders correctly. Here’s that code and screenshot:

else{
//BEGIN JOB POSTING
echo "<table border=1 width=200 height=200><tr>";
while($row_job = mysqli_fetch_array($result_job))
{
echo "<td>".$row_job['subject']."</td><br />";
}
mysqli_free_result($result_job);
echo "</tr></table>";
}

Data rendering correctly

While that’s fine, I want the data to display in different rows not different columns and can’t see where the error in the code is. What in the world is going on?

  • 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-06-14T09:56:54+00:00Added an answer on June 14, 2026 at 9:56 am

    After <tr> you need to encapsulate all data in <td>.

    else{
    //BEGIN JOB POSTING
    echo "<table border=1 width=200 height=200>";
    while($row_job = mysqli_fetch_array($result_job))
    {
    echo "<tr><td>".$row_job['subject']."</td></tr>";
    }
    mysqli_free_result($result_job);
    echo "</table>";
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

MUTANT TABLE DOES NOT EXIST.MY QUERY IS WORKING FINE BUT WHEN I AM TRYING
Recently a customer notified me of some special characters not rendering correctly. If this
I am trying to use django-tables to create a sortable table out of some
I am trying to read strings off a table in the database and use
Simplified Table structure: CREATE TABLE IF NOT EXISTS `hpa` ( `id` bigint(15) NOT NULL
SQL STRUCTURE CREATE TABLE IF NOT EXISTS `map` ( `id` int(11) NOT NULL AUTO_INCREMENT,
Given the table: CREATE TABLE IF NOT EXISTS `users` ( `id` bigint(20) NOT NULL
Using the command: CREATE TABLE IF NOT EXISTS `test`.`t1` ( `col` VARCHAR(16) NOT NULL
Using an Oracle temporary table does not generate much redo log as a normal
I have the following table: CREATE TABLE IF NOT EXISTS `customer_list` ( `id` INT

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.