Jump to content

Setting Tables side by side


ipPHPadmin

Recommended Posts

Hello everyone,

 

I'm trying to display two tables side by side in a php file.  I realize this may not be the correct forum for this, but i feel like its an html issue not php.  I have the code pulling all the information correctly from the database but its not displaying in tables correctly.  It's currently displaying two tables side by side but with the data in 5 columns instead of 5 rows.

Thanks in advance for the help.

 

 

<?php

 

$display = mysql_query("SELECT * FROM Artisan WHERE ART_ID = '".$ART_ID."'");

$numrows = mysql_num_rows($display);

 

if($numrows == 0)

{

die('Could not find artisan information: ' . mysql_error());

}

else

{

while($row = mysql_fetch_array($display))

{

$A_ID = $row["ART_ID"];

$A_Name = $row["ART_Name"];

 

?>

 

<table align = "center" width = "100%" border="0" style="font-size: 12px; margin-top: 30px; font-family: Tahoma;">

<tr>

<td align="right">Artisan Name:</td>

<td align="left"><?php echo $A_Name; ?> </td>

</tr>

<tr>

<td align="right">Artisan ID:</td>

<td align="left"><?php echo $A_ID; ?></td>

</tr>

</table>

 

<?php

 

$QuestionQuery = mysql_query("SELECT * FROM ArtisanQuestion ORDER BY ARQ_ID")or die ("Error retrieving artisan questions." . mysql_error());

 

while ($row = mysql_fetch_array($QuestionQuery))

{

$QuesID = $row["ARQ_ID"];

$Ques = $row["ARQ_Question"];

 

?>

 

<table  align = "left" width = "100px" height = "50px" border="0" style="font-size: 12px; margin-top: 30px; font-family: Tahoma;">

        <tr>

<td><?php echo $QuesID. ". ".$Ques; ?></td>

</tr>

</table>

 

<?php

}

 

$AnswerQuery = mysql_query("SELECT * FROM ArtisanAnswer WHERE ART_ID = '".$A_ID."' ORDER BY ARQ_ID ");

while ($row = mysql_fetch_array($AnswerQuery))

{

$Ans = $row["ARAN_Answer"];

 

?>

 

<table align = "right" width = "100px"  border="0" style="font-size: 12px; margin-top: 30px; font-family: Tahoma;">

<tr>

<td><?php echo $Ans; ?> </td>

</tr>

</table>

<?php

}

}

}

}

?>

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.