Jump to content

Dotted line or gif within php loop


mikebyrne

Recommended Posts

I was wondering if it would be possible to insert a dotted line or gif within my php loop to seperate each record ie the line to appear under each record

 

My loop looks like this:

 

<form method="post" action="edit.php">
        <table width="850" border="0" cellspacing="0" cellpadding="0">
  <tr align="left">
    <td> </td>
    <td><a href="#">serial no.[/url]</td>
    <td><a href="#">product name[/url]</td>
    <td>display order</td>
    <td><a href="#">display[/url]</td>
    <td><a href="#">pricet[/url]</td>
    <td> </td>
    <td>action</td>
  </tr>
<?php
// let's get some data
include('adminconnect.php');
$query = "SELECT ProductNo,ProductName,Display,Price FROM Product WHERE Producttype = 'Game' ";
$result = mysql_query($query) or die (mysql_error());
while ($row = mysql_fetch_array($result)){
// loop through and display
?>

  <tr align="left">
    <td><input type="radio" value="ProductNo<?php echo $row['ProductNo']; ?>" name="something" /></td>
    <td><a class="black"><?php echo $row['ProductNo'];?></a></td>
    <td><?php echo $row['ProductName'];?></td>
    <td>Display order results</td>
    <td><?php echo $row['Display'] ;?></td>
    <td><?php echo $row['Price'];?></td>
    <td> </td>
    <td><input type="submit" name="submit" value="Edit" /></td>
  </tr>
<?php
}
?>
</table>

 

I've also attached a screenshot of my current page

Link to comment
https://forums.phpfreaks.com/topic/93364-dotted-line-or-gif-within-php-loop/
Share on other sites

<form method="post" action="edit.php">
        <table width="850" border="0" cellspacing="0" cellpadding="0">
  <tr align="left">
    <td> </td>
    <td><a href="#">serial no.[/url]</td>
    <td><a href="#">product name[/url]</td>
    <td>display order</td>
    <td><a href="#">display[/url]</td>
    <td><a href="#">pricet[/url]</td>
    <td> </td>
    <td>action</td>
  </tr>
<?php
// let's get some data
include('adminconnect.php');
$query = "SELECT ProductNo,ProductName,Display,Price FROM Product WHERE Producttype = 'Game' ";
$result = mysql_query($query) or die (mysql_error());
while ($row = mysql_fetch_array($result)){
// loop through and display
?>

  <tr align="left">
    <td><input type="radio" value="ProductNo<?php echo $row['ProductNo']; ?>" name="something" /></td>
    <td><a class="black"><?php echo $row['ProductNo'];?></a></td>
    <td><?php echo $row['ProductName'];?></td>
    <td>Display order results</td>
    <td><?php echo $row['Display'] ;?></td>
    <td><?php echo $row['Price'];?></td>
    <td> </td>
    <td><input type="submit" name="submit" value="Edit" /></td>
  </tr>

<tr><td>Put your gif or line here</td></tr>
<?php
}
?>
</table>

As I said in your other post, I would use a link to the edit page rather than a form since it might confuse a user. Looking at your screenshot, the user might have the first row checked but want to edit the 3rd. They are more than likely to just click on the edit button on the third row without checking the 3rd radio button.

 

Alternatively, take the edit button out of the loop and just have one at the end.

Would I be better off just removing the radio buttons altogether and just leaving the edit buttons??

 

Also would I manually have to adjust the length of the dotted line in the loop ie

 

---------------------------------------------------------------------------

 

to stretch across the length of my table?

The dotted line seems just to appear under the radio button and I've attached a screenshot of same

 

<form method="post" action="edit.php">
        <table width="850" border="0" cellspacing="0" cellpadding="0">
  <tr align="left">
    <td> </td>
    <td><a href="#">serial no.[/url]</td>
    <td><a href="#">product name[/url]</td>
    <td>display order</td>
    <td><a href="#">display[/url]</td>
    <td><a href="#">pricet[/url]</td>
    <td> </td>
    <td>action</td>
  </tr>
<?php
// let's get some data
include('adminconnect.php');
$query = "SELECT ProductNo,ProductName,Display,Price FROM Product WHERE Producttype = 'Game' ";
$result = mysql_query($query) or die (mysql_error());
while ($row = mysql_fetch_array($result)){
// loop through and display
?>

  <tr align="left">
    <td><input type="radio" value="ProductNo<?php echo $row['ProductNo']; ?>" name="something" /></td>
    <td><a class="black"><?php echo $row['ProductNo'];?></a></td>
    <td><?php echo $row['ProductName'];?></td>
    <td>Display order results</td>
    <td><?php echo $row['Display'] ;?></td>
    <td><?php echo $row['Price'];?></td>
    <td> </td>
    <td><input type="submit" name="submit" value="Edit" /></td>
  </tr>

<tr><td>----------------------------------------------------------------------------</td></tr>
<?php
}
?>
</table>

 

 

Ok.

 

I would keep the radio buttons, but only have one edit button at the end of your form.

 

As for the dotted line. Use a hr tag and some css to make it dashed.

You need to set your colspan to make the td that the contains the hr, span across all your columns. (unless you make each entry have it's own table instead.)

 

replace:

<tr><td>----------------------------------------------------------------------------</td></tr>

 

with:

<tr><td colspan="8"><hr /></td></tr>

 

Add this in your css file (without html parts) or in the head section of your html (with html parts):

<style type="text/css">
<!--
hr {
border-top:none;
border-bottom: 1px dashed #A5AEC5;
}
-->
</style>

 

As a final note, check your links at the top of the table. You have closing "url" tags instead of closing "a" tags

Thanks for the quick responce.

 

How do I structure it to appear in my stylesheet as I hope to use it in more tables?

 

My stylesheet looks like this:

 


/* CSS Document */


#Box{ 
width:931px;
height:auto;
padding:0px 0px 0px 0px;
margin:0px 0px 0px 0px;
}

#logoBox{ 
width:81px;
height:auto;
padding:0px 0px 0px 0px;
margin:0px 0px 0px 0px;
background-image:url(../Admin_files/bg_logo.gif);
float:left;
}
#contentBox{ 
width:850px;
height:auto;
padding:0px 0px 0px 0px;
margin:0px 0px 0px 0px;
float:right;
}

.clr {
clear:both;
}
.clrIE {
clear:both;
display:inline;
}
.textError{
color:#b91518;
}

body {
font-family: Arial, Helvetica, sans-serif;
background-image:url(../Admin_files/bg_logo.gif);
background-repeat:repeat-y;
background-color: #ffffff;
padding:0px 0px 0px 0px;
margin:0px 0px 0px 0px;
font-size: 11px;
color: #595959;
line-height:150%;

}
#container { 
    width:850px; 
    margin-left: auto;
margin-right: auto;
}
#containerBg1 { 
    width:850px; 
    margin-left: auto;
margin-right: auto;
background-image:url(../Admin_files/bg01.gif);
}
#containerBg2 { 
    width:850px;
height:20px;
    margin-left: auto;
margin-right: auto;
background-image:url(../Admin_files/bg02.gif);
}


#containerBg3 { 
    width:850px;
    margin-left: auto;
margin-right: auto;
background-image:url(../Admin_files/bg03.gif);
}
#containerBg4 { 
    width:850px; 
    margin-left: auto;
margin-right: auto;
background-image:url(../Admin_files/bg04.gif);
}



#dotted{
width:auto;
height:1px;
background-image:url(../Admin_files/bg05.gif);
}
#line{
width:auto;
height:1px;
background-color:#c6c5c5;
}
#logo { 
width:850px;
height:50px;
background-image:url(../Admin_files/logo.gif);
background-repeat:no-repeat;
}
#frameIn1{ 
width:850px;
height:20px;
background-image:url(../Admin_files/bg01.gif);
}
#dataTitle{ 
width:850px;
height:20px;
background-image:url(../Admin_files/bg02.gif);
}


#titleBox{ 
width:850px;
height:20px;
padding:0px 0px 0px 0px;
margin:0px 0px 0px 0px;
}

#dottedIn{ 
width:850px;
height:1px;
background-image:url(../Admin_files/bg05.gif);
padding:0px 0px 0px 0px;
margin:0px 0px 0px 0px;
}

#menu_off{ 
width:6px;
height:6px;
padding:0px 0px 0px 0px;
margin:5px 0px 0px 0px;
float:left;
background-image:url(../Admin_files/menu_off.gif);
background-repeat:no-repeat;
}
#menu_on{ 
width:6px;
height:6px;
padding:0px 0px 0px 0px;
margin:5px 0px 0px 0px;
float:left;
background-image:url(../Admin_files/menu_on.gif);
background-repeat:no-repeat;
}
#menu_hide{ 
width:6px;
height:6px;
padding:0px 0px 0px 0px;
margin:5px 0px 0px 0px;
float:left;
}

#menu_text_off{ 
width:auto;
height:auto;
padding:0px 0px 0px 6px;
margin:0px 0px 0px 0px;
float:left;
}

#menu_text_on{ 
width:auto;
height:auto;
padding:0px 0px 0px 6px;
margin:0px 0px 0px 0px;
font-weight:bold;
color:#000000;
float:left;
}

#menu_text_on_hide{ 
width:auto;
height:auto;
padding:0px 0px 0px 6px;
margin:0px 0px 0px 0px;
font-weight:bold;
color:#ffffff;
float:left;
}
#menu_space1{ 
width:48px;
height:6px;
padding:0px 0px 0px 0px;
margin:0px 0px 0px 0px;
float:left;
}
#menu_space2{ 
width:24px;
height:6px;
padding:0px 0px 0px 0px;
margin:0px 0px 0px 0px;
float:left;
}

.textWhite{
color:#FFFFFF;
}
.textBlack{
color:#000000;
}
.textBlackB{
color:#000000;
font-weight:bold;
}

#btn{
width:818px;
height:auto;
padding:0px 32px 0px px;
margin:0px 0px 0px 0px;
text-align:right;
}

#btn2{
width:818px;
height:auto;
padding:0px 0px 0px 32px;
margin:0px 0px 0px 0px;
text-align:left;
}

#btn3{
width:818px;
height:auto;
padding:0px 0px 0px 32px;
margin:0px 0px 0px 0px;
text-align:center;
}

#btnL{
width:auto;
height:23px;
padding:0px 0px 0px 0px;
margin:0px 0px 0px 0px;
float:right;
}
#btnR{
width:auto;
height:23px;
padding:0px 0px 0px 0px;
margin:0px 0px 0px 0px;
float:right;
}
#btnSpace{
width:16px;
height:23px;
padding:0px 0px 0px 0px;
margin:0px 0px 0px 0px;
float:right;
}
#btn_text{
width:auto;
height:auto;
padding:0px 32px 0px 32px;
margin:0px 0px 0px 0px;
text-align:center;
}
#text_confirm{
width:auto;
height:30px;
padding:0px 32px 0px 32px;
margin:0px 0px 0px 0px;
text-align:right;
}
#titleText{
width:auto;
height:auto;
padding:0px 32px 0px 18px;
margin:0px 0px 0px 0px;
color:#000000;
font-weight:bold;
text-align:left;
}
#sales_text_and{
width:auto;
height:auto;
padding:0px 32px 0px 90px;
margin:0px 0px 0px 0px;
text-align:left;
}

.tableData{
width:850px;
height:auto;
padding:0px 0px 0px 0px;
margin:0px 0px 0px 0px;
text-align:center;
}

.editLeft{
width:324px;
height:auto;
padding:0px 0px 0px 0px;
margin:0px 0px 0px 0px;
float:left;
}
.editRight{
width:526px;
height:auto;
padding:0px 0px 0px 0px;
margin:0px 0px 0px 0px;
float:right;
}
.editLeftBox{
width:291px;
height:auto;
padding:0px 0px 0px 33px;
margin:0px 0px 0px 0px;
float:left;
}

.editLeftText{
width:33px;
height:auto;
padding:0px 0px 0px 0px;
margin:0px 0px 0px 0px;
text-align:left;
float:left;
}
.editLeftForm{
width:258px;
height:auto;
padding:0px 0px 0px 0px;
margin:0px 0px 0px 0px;
text-align:left;
float:left;
}

.editRightBox{
width:526px;
height:auto;
padding:0px 0px 0px 0px;
margin:0px 0px 0px 0px;
float:left;
}
.editRightText{
width:74px;
height:auto;
padding:3px 0px 0px 0px;
margin:0px 0px 0px 0px;
text-align:left;
float:left;
}
.editRightForm{
width:452px;
height:auto;
padding:0px 0px 0px 0px;
margin:0px 0px 0px 0px;
text-align:left;
float:left;
}
.editRadio1{
width:24px;
height:auto;
padding:0px 0px 0px 0px;
margin:0px 0px 0px 0px;
text-align:left;
float:left;
}
.editRadio2{
width:50px;
height:auto;
padding:2px 0px 0px 0px;
margin:0px 0px 0px 0px;
text-align:left;
float:left;
}
.editRadio3{
width:24px;
height:auto;
padding:0px 0px 0px 0px;
margin:0px 0px 0px 0px;
text-align:left;
float:left;
}
.editRadio4{
width:50px;
height:auto;
padding:2px 0px 0px 0px;
margin:0px 0px 0px 0px;
text-align:left;
float:left;
}
.editRadio5{
width:100px;
height:auto;
padding:2px 0px 0px 0px;
margin:0px 0px 0px 0px;
text-align:left;
float:left;
}

.editRadioLink1{
width:24px;
height:auto;
padding:0px 0px 0px 0px;
margin:0px 0px 0px 0px;
text-align:left;
float:left;
}
.editRadioLink2{
width:50px;
height:auto;
padding:2px 0px 0px 0px;
margin:0px 0px 0px 0px;
text-align:left;
float:left;
}
.editRadioLink3{
width:24px;
height:auto;
padding:0px 0px 0px 0px;
margin:0px 0px 0px 0px;
text-align:left;
float:left;
}
.editRadioLink4{
width:120px;
height:auto;
padding:2px 0px 0px 0px;
margin:0px 0px 0px 0px;
text-align:left;
float:left;
}
.editRadioLink5{
width:100px;
height:auto;
padding:0px 0px 0px 0px;
margin:0px 0px 0px 0px;
text-align:left;
float:left;
}



.editItemPrice1{
width:14px;
height:auto;
padding:3px 0px 0px 0px;
margin:0px 0px 0px 0px;
text-align:left;
float:left;
}
.editItemPrice2{
width:100px;
height:auto;
padding:0px 0px 0px 0px;
margin:0px 0px 0px 0px;
text-align:left;
float:left;
}

.editSize1{
width:266px;
height:auto;
padding:0px 0px 0px 0px;
margin:0px 0px 0px 0px;
text-align:left;
float:left;
}
.editSize2{
width:24px;
height:auto;
padding:0px 0px 0px 0px;
margin:0px 0px 0px 0px;
text-align:left;
float:left;
}
.editSize3{
width:40px;
height:auto;
padding:2px 0px 0px 0px;
margin:0px 0px 0px 0px;
text-align:left;
float:left;
}
.editSize4{
width:24px;
height:auto;
padding:0px 0px 0px 0px;
margin:0px 0px 0px 0px;
text-align:left;
float:left;
}
.editSize5{
width:40px;
height:auto;
padding:2px 0px 0px 0px;
margin:0px 0px 0px 0px;
text-align:left;
float:left;
}
.editSize6{
width:99px;
height:auto;
padding:0px 0px 0px 0px;
margin:0px 0px 0px 0px;
text-align:center;
float:left;
}
.editSize7{
width:33px;
height:auto;
padding:0px 0px 0px 0px;
margin:0px 0px 0px 0px;
text-align:center;
float:left;
}

.editSizeTitle1{
width:266px;
height:auto;
padding:0px 0px 0px 0px;
margin:0px 0px 0px 0px;
text-align:left;
float:left;
}
.editSizeTitle2{
width:128px;
height:auto;
padding:0px 0px 0px 0px;
margin:0px 0px 0px 0px;
text-align:left;
float:left;
}
.editSizeTitle3{
width:99px;
height:auto;
padding:0px 0px 0px 0px;
margin:0px 0px 0px 0px;
text-align:center;
float:left;
}
.editSizeTitle4{
width:33px;
height:auto;
padding:0px 0px 0px 0px;
margin:0px 0px 0px 0px;
float:left;
}
.editSizeLineL{
width:493px;
height:auto;
padding:0px 0px 0px 0px;
margin:0px 0px 0px 0px;
float:left;
}
.editSizeLineR{
width:33px;
height:auto;
padding:0px 0px 0px 0px;
margin:0px 0px 0px 0px;
float:left;
}


.padTop400 { padding-top:400px; }
.padTop300 { padding-top:300px; }
.padTop240 { padding-top:240px; }
.padTop220 { padding-top:220px; }
.padTop200 { padding-top:200px; }
.padTop100 { padding-top:100px; }
.padTop90 { padding-top:90px; }
.padTop80 { padding-top:80px; }
.padTop77 { padding-top:77px; }
.padTop75 { padding-top:75px; }
.padTop70 { padding-top:70px; }
.padTop60 { padding-top:60px; }
.padTop50 { padding-top:50px; }
.padTop47 { padding-top:47px; }
.padTop46 { padding-top:46px; }
.padTop41 { padding-top:41px; }
.padTop40 { padding-top:40px; }
.padTop38 { padding-top:38px; }
.padTop37 { padding-top:37px; }
.padTop36 { padding-top:36px; }
.padTop35 { padding-top:35px; }
.padTop33 { padding-top:33px; }
.padTop32 { padding-top:32px; }
.padTop31 { padding-top:31px; }
.padTop30 { padding-top:30px; }
.padTop29 { padding-top:29px; }
.padTop28 { padding-top:28px; }
.padTop27 { padding-top:27px; }
.padTop24 { padding-top:24px; }
.padTop23 { padding-top:23px; }
.padTop22 { padding-top:22px; }
.padTop20 { padding-top:20px; }
.padTop19 { padding-top:19px; }
.padTop18 { padding-top:18px; }
.padTop17 { padding-top:17px; }
.padTop16 { padding-top:16px; }
.padTop15 { padding-top:15px; }
.padTop14 { padding-top:14px; }
.padTop13 { padding-top:13px; }
.padTop12 { padding-top:12px; }
.padTop11 { padding-top:11px; }
.padTop10 { padding-top:10px; }
.padTop9 { padding-top:9px; }
.padTop8 { padding-top:8px; }
.padTop7 { padding-top:7px; }
.padTop6 { padding-top:6px; }
.padTop5 { padding-top:5px; }
.padTop4 { padding-top:4px; }
.padTop3 { padding-top:3px; }
.padTop2 { padding-top:2px; }
.padTop1 { padding-top:1px; }


a:visited {
text-decoration: none;
color: #879cc3;
}

a:link {
text-decoration: none; 
color: #879cc3;
}
a:hover {
text-decoration: underline;
color: #879cc3;
}
a:active {
text-decoration: none;
color: #879cc3;
}

a.black:link {color: #575757; text-decoration: none;}
a.black:visited {text-decoration: none; color: #575757;}
a.black:hover {text-decoration: underline; color: #879cc3;}
a.black:active {text-decoration: none; color: #879cc3;}

a.black_on:link {color: #000000; text-decoration: none;}
a.black_on:visited {text-decoration: none; color: #000000;}
a.black_on:hover {text-decoration: underline; color: #879cc3;}
a.black_on:active {text-decoration: none; color: #000000;}




input.order1Form1{
width:166px;
height:auto;
font-size:11px;
background-color: #ffffff;
border: solid 1px; 
border-color: #c3c3c3;
}
input.coupon2Form1{
width:200px;
height:auto;
font-size:11px;
background-color: #ffffff;
border: solid 1px; 
border-color: #c3c3c3;
}
input.coupon2Form2{
width:40px;
height:auto;
font-size:11px;
background-color: #ffffff;
border: solid 1px; 
border-color: #c3c3c3;
}
input.shippingForm1{
width:40px;
height:auto;
font-size:11px;
background-color: #ffffff;
border: solid 1px; 
border-color: #c3c3c3;
}
input.newsUpFile{
width:245px;
height:auto;
font-size:11px;
background-color: #ffffff;
border: solid 1px; 
border-color: #c3c3c3;
}
input.newsEditForm01{
width:418px;
height:auto;
font-size:11px;
background-color: #ffffff;
border: solid 1px; 
border-color: #c3c3c3;
}
input.newsEditForm02{
width:73px;
height:auto;
font-size:11px;
background-color: #ffffff;
border: solid 1px; 
border-color: #c3c3c3;
}
textarea.newsEditForm03{
width:418px;
height:240px;
font-size:11px;
background-color: #ffffff;
border: solid 1px; 
border-color: #c3c3c3;
}

input.itemEditForm01{
width:418px;
height:auto;
font-size:11px;
background-color: #ffffff;
border: solid 1px; 
border-color: #c3c3c3;
}
input.itemEditForm02{
width:200px;
height:auto;
font-size:11px;
background-color: #ffffff;
border: solid 1px; 
border-color: #c3c3c3;
}
textarea.itemEditForm03{
width:418px;
height:240px;
font-size:11px;
background-color: #ffffff;
border: solid 1px; 
border-color: #c3c3c3;
}
input.itemEditForm04{
width:73px;
height:auto;
font-size:11px;
background-color: #ffffff;
border: solid 1px; 
border-color: #c3c3c3;
}

 

 

Yeah thats working, thanks!!

 

One small problem is the dotted line goes over the white and into the grey on both sides (I've attached screenshots of same)

 

Also, I want to replace the edit buttons with the radio buttons and just have one edit button.

 

How would I recode what I have?

 

	<!-- data start -->
<form method="post" action="edit.php">
        <table width="850" border="0" cellspacing="0" cellpadding="0">
  <tr align="left">
    <td> </td>
    <td><a href="#">serial no.[/url]</td>
    <td><a href="#">product name[/url]</td>
    <td>display order</td>
    <td><a href="#">display[/url]</td>
    <td><a href="#">pricet[/url]</td>
    <td> </td>
    <td>action</td>
  </tr>
<?php
// let's get some data
include('adminconnect.php');
$query = "SELECT ProductNo,ProductName,Display,Price FROM Product WHERE Producttype = 'Game' ";
$result = mysql_query($query) or die (mysql_error());
while ($row = mysql_fetch_array($result)){
// loop through and display
?>

  <tr align="left">
    <td><input type="radio" value="ProductNo<?php echo $row['ProductNo']; ?>" name="something" /></td>
    <td><a class="black"><?php echo $row['ProductNo'];?></a></td>
    <td><?php echo $row['ProductName'];?></td>
    <td>Display order results</td>
    <td><?php echo $row['Display'] ;?></td>
    <td><?php echo $row['Price'];?></td>
    <td> </td>
    <td><input type="submit" name="submit" value="Edit" /></td>
  </tr>

<tr><td colspan="8"><hr /></td></tr>
<?php
}
?>
</table>

 

This I think should fix both problems:

 

<!-- data start -->
<form method="post" action="edit.php">
        <table width="850" border="0" cellspacing="0" cellpadding="0">
  <tr align="left">
    <td> </td>
    <td><a href="#">serial no.[/url]</td>
    <td><a href="#">product name[/url]</td>
    <td>display order</td>
    <td><a href="#">display[/url]</td>
    <td><a href="#">pricet[/url]</td>
  </tr>
<?php
// let's get some data
include('adminconnect.php');
$query = "SELECT ProductNo,ProductName,Display,Price FROM Product WHERE Producttype = 'Game' ";
$result = mysql_query($query) or die (mysql_error());
while ($row = mysql_fetch_array($result)){
// loop through and display
?>

  <tr align="left">
    <td><input type="radio" value="ProductNo<?php echo $row['ProductNo']; ?>" name="something" /></td>
    <td><a class="black"><?php echo $row['ProductNo'];?></a></td>
    <td><?php echo $row['ProductName'];?></td>
    <td>Display order results</td>
    <td><?php echo $row['Display'] ;?></td>
    <td><?php echo $row['Price'];?></td>
  </tr>

<tr><td> </td><td colspan="4"><hr /></td><td></tr>
<?php
}
?>
<tr><td><input type="submit" name="submit" value="Edit" /></td></tr>
</table>

The line doesnt go all the way across (I attached a screenshot)

 

I'd like to put another header "SELECT" and put the radio buttons under this. How can I code that (Ive tried but my Select just replaces Prodct No)

 

My code now is:

 

<!-- data start -->
<form method="post" action="edit.php">
        <table width="850" border="0" cellspacing="0" cellpadding="0">
  <tr align="left">
    <td> </td>
    <td><a href="#">PRODCT NO</a></td>
    <td><a href="#">PRODUCT NAME</a></td>
    <td><a href="#">STOCK LEVEL</a></td>
    <td><a href="#">DISPLAY</a></td>
    <td><a href="#">PRICE</a></td>
  </tr>
<?php
// let's get some data
include('adminconnect.php');
$query = "SELECT ProductNo,ProductName,Stockamount,Display,Price FROM Product WHERE Producttype = 'Game' ";
$result = mysql_query($query) or die (mysql_error());
while ($row = mysql_fetch_array($result)){
// loop through and display
?>

  <tr align="left">
    <td><input type="radio" value="ProductNo<?php echo $row['ProductNo']; ?>" name="something" /></td>
    <td><a class="black"><?php echo $row['ProductNo'];?></a></td>
    <td><?php echo $row['ProductName'];?></td>
    <td><?php echo $row['Stockamount'];?></td>
    <td><?php echo $row['Display'] ;?></td>
    <td><?php echo $row['Price'];?></td>
  </tr>

<tr><td> </td><td colspan="4"><hr /></td><td></tr>
<?php
}
?>
<tr><td><input type="submit" name="submit" value="Edit" /></td></tr>
</table>
[code]

[/code]

Ah, I made a small mistake and yes I do understand what colspan does. I haven't tested it so it might have some bugs. I assumed he would try it then tell me what wasn't working and then I would correct it.

 

<!-- data start -->
<form method="post" action="edit.php">
        <table width="850" border="0" cellspacing="0" cellpadding="0">
  <tr align="left">
    <td> </td>
    <td><a href="#">serial no.[/url]</td>
    <td><a href="#">product name[/url]</td>
    <td>display order</td>
    <td><a href="#">display[/url]</td>
    <td><a href="#">pricet[/url]</td>
  </tr>
<?php
// let's get some data
include('adminconnect.php');
$query = "SELECT ProductNo,ProductName,Display,Price FROM Product WHERE Producttype = 'Game' ";
$result = mysql_query($query) or die (mysql_error());
while ($row = mysql_fetch_array($result)){
// loop through and display
?>

  <tr align="left">
    <td><input type="radio" value="ProductNo<?php echo $row['ProductNo']; ?>" name="something" /></td>
    <td><a class="black"><?php echo $row['ProductNo'];?></a></td>
    <td><?php echo $row['ProductName'];?></td>
    <td>Display order results</td>
    <td><?php echo $row['Display'] ;?></td>
    <td><?php echo $row['Price'];?></td>
  </tr>

<tr><td> </td><td colspan="4"><hr /></td><td> </td></tr>
<?php
}
?>
<tr><td><input type="submit" name="submit" value="Edit" /></td></tr>
</table>

<!-- data start -->
<form method="post" action="edit.php">
        <table width="850" border="0" cellspacing="0" cellpadding="0">
  <tr align="left">
    <td>SELECT</td>
    <td><a href="#">serial no.</a></td>
    <td><a href="#">product name</a></td>
    <td>display order</td>
    <td><a href="#">display</a></td>
    <td><a href="#">pricet</a></td>
  </tr>
<?php
// let's get some data
include('adminconnect.php');
$query = "SELECT ProductNo,ProductName,Display,Price FROM Product WHERE Producttype = 'Game' ";
$result = mysql_query($query) or die (mysql_error());
while ($row = mysql_fetch_array($result)){
// loop through and display
?>

  <tr align="left">
    <td><input type="radio" value="ProductNo<?php echo $row['ProductNo']; ?>" name="something" /></td>
    <td><a class="black"><?php echo $row['ProductNo'];?></a></td>
    <td><?php echo $row['ProductName'];?></td>
    <td>Display order results</td>
    <td><?php echo $row['Display'] ;?></td>
    <td><?php echo $row['Price'];?></td>
  </tr>

<tr><td> </td><td colspan="5"><hr /></td><td> </td></tr>
<?php
}
?>
<tr><td><input type="submit" name="submit" value="Edit" /></td></tr>
</table>

Thanks for the colspan advice, makes sense now

 

I've adjusted the code as follows

 

<!-- data start -->
<form method="post" action="edit.php">
        <table width="850" border="0" cellspacing="0" cellpadding="0">
  <tr align="left">
    <td><a href="#">SELECT</a></td>
    <td><a href="#">PRODCT NO</a></td>
    <td><a href="#">PRODUCT NAME</a></td>
    <td><a href="#">STOCK LEVEL</a></td>
    <td><a href="#">DISPLAY</a></td>
    <td><a href="#">PRICE</a></td>
  </tr>
<?php
// let's get some data
include('adminconnect.php');
$query = "SELECT ProductNo,ProductName,Stockamount,Display,Price FROM Product WHERE Producttype = 'Game' ";
$result = mysql_query($query) or die (mysql_error());
while ($row = mysql_fetch_array($result)){
// loop through and display
?>

  <tr align="left">
    <td><input type="radio" value="ProductNo<?php echo $row['ProductNo']; ?>" name="something" /></td>
    <td><a class="black"><?php echo $row['ProductNo'];?></a></td>
    <td><?php echo $row['ProductName'];?></td>
    <td><?php echo $row['Stockamount'];?></td>
    <td><?php echo $row['Display'] ;?></td>
    <td><?php echo $row['Price'];?></td>
  </tr>

<tr><td> </td><td colspan="5"><hr /></td><td></tr>
<?php
}
?>
<tr><td><input type="submit" name="submit" value="Edit" /></td></tr>
</table>

 

But I'd like to move the Select across to the right so its in the white box and have the dotted line just across this box. Ive attached a current screenshot




<!-- top start -->
<div id="container">

	<div id="line"><!-- --></div>
</div>
<div class="clr"><!-- --></div>
<div id="containerBg1">
	<div class="padTop15"><!-- --></div>
	<div class="clr"><!-- --></div>
</div>
<div class="clr"><!-- --></div>
<!-- top finish -->









<!-- 1px space start -->
<div id="containerBg1">
	<div class="padTop1"><!-- --></div>
	<div class="clr"><!-- --></div>
</div>
<div class="clr"><!-- --></div>
<!-- 1px space finish -->



<!-- data top start -->
<div id="containerBg3">

	<div class="padTop1"><!-- --></div>
	<div class="clr"><!-- --></div>
</div>
<div class="clr"><!-- --></div>
<!-- data top finish -->



<!-- data content start -->
<div id="containerBg4">

<!-- data start -->
<form method="post" action="edit.php">
        <table width="850" border="0" cellspacing="0" cellpadding="0">
  <tr align="left">
    <td><a href="#">SELECT</a></td>
    <td><a href="#">PRODCT NO</a></td>
    <td><a href="#">PRODUCT NAME</a></td>
    <td><a href="#">STOCK LEVEL</a></td>
    <td><a href="#">DISPLAY</a></td>
    <td><a href="#">PRICE</a></td>
  </tr>
<?php
// let's get some data
include('adminconnect.php');
$query = "SELECT ProductNo,ProductName,Stockamount,Display,Price FROM Product WHERE Producttype = 'Game' ";
$result = mysql_query($query) or die (mysql_error());
while ($row = mysql_fetch_array($result)){
// loop through and display
?>

  <tr align="left">
    <td><input type="radio" value="ProductNo<?php echo $row['ProductNo']; ?>" name="something" /></td>
    <td><a class="black"><?php echo $row['ProductNo'];?></a></td>
    <td><?php echo $row['ProductName'];?></td>
    <td><?php echo $row['Stockamount'];?></td>
    <td><?php echo $row['Display'] ;?></td>
    <td><?php echo $row['Price'];?></td>
  </tr>

<tr><td> </td><td colspan="5"><hr /></td><td></tr>
<?php
}
?>
<tr><td><input type="submit" name="submit" value="Edit" /></td></tr>
</table>



</div>
<div class="clr"><!-- --></div>
<!-- data content finish -->



<!-- data btm start -->
<div id="containerBg3">

	<div class="padTop1"><!-- --></div>
	<div class="clr"><!-- --></div>
</div>
<div class="clr"><!-- --></div>
<!-- data btm finish -->



<!-- btm start -->
<div id="containerBg1">
	<div class="padTop15"><!-- --></div>
	<div class="clr"><!-- --></div>

</div>
<div class="clr"><!-- --></div>
<div id="container">
	<div id="line"><!-- --></div>
</div>
<div class="clr"><!-- --></div>
<div class="padTop16"><!-- --></div>
<div class="clr"><!-- --></div>
<!-- btm finish -->


</div>

</div>
</body>
</html>

/* CSS Document */


#Box{ 
width:931px;
height:auto;
padding:0px 0px 0px 0px;
margin:0px 0px 0px 0px;
}

#logoBox{ 
width:81px;
height:auto;
padding:0px 0px 0px 0px;
margin:0px 0px 0px 0px;
background-image:url(../Admin_files/bg_logo.gif);
float:left;
}
#contentBox{ 
width:850px;
height:auto;
padding:0px 0px 0px 0px;
margin:0px 0px 0px 0px;
float:right;
}

.clr {
clear:both;
}
.clrIE {
clear:both;
display:inline;
}
.textError{
color:#b91518;
}

body {
font-family: Arial, Helvetica, sans-serif;
background-image:url(../Admin_files/bg_logo.gif);
background-repeat:repeat-y;
background-color: #ffffff;
padding:0px 0px 0px 0px;
margin:0px 0px 0px 0px;
font-size: 11px;
color: #595959;
line-height:150%;

}
#container { 
    width:850px; 
    margin-left: auto;
margin-right: auto;
}
#containerBg1 { 
    width:850px; 
    margin-left: auto;
margin-right: auto;
background-image:url(../Admin_files/bg01.gif);
}
#containerBg2 { 
    width:850px;
height:20px;
    margin-left: auto;
margin-right: auto;
background-image:url(../Admin_files/bg02.gif);
}


#containerBg3 { 
    width:850px;
    margin-left: auto;
margin-right: auto;
background-image:url(../Admin_files/bg03.gif);
}
#containerBg4 { 
    width:850px; 
    margin-left: auto;
margin-right: auto;
background-image:url(../Admin_files/bg04.gif);
}



#dotted{
width:auto;
height:1px;
background-image:url(../Admin_files/bg05.gif);
}
#line{
width:auto;
height:1px;
background-color:#c6c5c5;
}
#logo { 
width:850px;
height:50px;
background-image:url(../Admin_files/logo.gif);
background-repeat:no-repeat;
}
#frameIn1{ 
width:850px;
height:20px;
background-image:url(../Admin_files/bg01.gif);
}
#dataTitle{ 
width:850px;
height:20px;
background-image:url(../Admin_files/bg02.gif);
}


#titleBox{ 
width:850px;
height:20px;
padding:0px 0px 0px 0px;
margin:0px 0px 0px 0px;
}

#dottedIn{ 
width:850px;
height:1px;
background-image:url(../Admin_files/bg05.gif);
padding:0px 0px 0px 0px;
margin:0px 0px 0px 0px;
}

#menu_off{ 
width:6px;
height:6px;
padding:0px 0px 0px 0px;
margin:5px 0px 0px 0px;
float:left;
background-image:url(../Admin_files/menu_off.gif);
background-repeat:no-repeat;
}
#menu_on{ 
width:6px;
height:6px;
padding:0px 0px 0px 0px;
margin:5px 0px 0px 0px;
float:left;
background-image:url(../Admin_files/menu_on.gif);
background-repeat:no-repeat;
}
#menu_hide{ 
width:6px;
height:6px;
padding:0px 0px 0px 0px;
margin:5px 0px 0px 0px;
float:left;
}

#menu_text_off{ 
width:auto;
height:auto;
padding:0px 0px 0px 6px;
margin:0px 0px 0px 0px;
float:left;
}

#menu_text_on{ 
width:auto;
height:auto;
padding:0px 0px 0px 6px;
margin:0px 0px 0px 0px;
font-weight:bold;
color:#000000;
float:left;
}

#menu_text_on_hide{ 
width:auto;
height:auto;
padding:0px 0px 0px 6px;
margin:0px 0px 0px 0px;
font-weight:bold;
color:#ffffff;
float:left;
}
#menu_space1{ 
width:48px;
height:6px;
padding:0px 0px 0px 0px;
margin:0px 0px 0px 0px;
float:left;
}
#menu_space2{ 
width:24px;
height:6px;
padding:0px 0px 0px 0px;
margin:0px 0px 0px 0px;
float:left;
}

.textWhite{
color:#FFFFFF;
}
.textBlack{
color:#000000;
}
.textBlackB{
color:#000000;
font-weight:bold;
}

#btn{
width:818px;
height:auto;
padding:0px 32px 0px px;
margin:0px 0px 0px 0px;
text-align:right;
}

#btn2{
width:818px;
height:auto;
padding:0px 0px 0px 32px;
margin:0px 0px 0px 0px;
text-align:left;
}

#btn3{
width:818px;
height:auto;
padding:0px 0px 0px 32px;
margin:0px 0px 0px 0px;
text-align:center;
}

#btnL{
width:auto;
height:23px;
padding:0px 0px 0px 0px;
margin:0px 0px 0px 0px;
float:right;
}
#btnR{
width:auto;
height:23px;
padding:0px 0px 0px 0px;
margin:0px 0px 0px 0px;
float:right;
}
#btnSpace{
width:16px;
height:23px;
padding:0px 0px 0px 0px;
margin:0px 0px 0px 0px;
float:right;
}
#btn_text{
width:auto;
height:auto;
padding:0px 32px 0px 32px;
margin:0px 0px 0px 0px;
text-align:center;
}
#text_confirm{
width:auto;
height:30px;
padding:0px 32px 0px 32px;
margin:0px 0px 0px 0px;
text-align:right;
}
#titleText{
width:auto;
height:auto;
padding:0px 32px 0px 18px;
margin:0px 0px 0px 0px;
color:#000000;
font-weight:bold;
text-align:left;
}
#sales_text_and{
width:auto;
height:auto;
padding:0px 32px 0px 90px;
margin:0px 0px 0px 0px;
text-align:left;
}

.tableData{
width:850px;
height:auto;
padding:0px 0px 0px 0px;
margin:0px 0px 0px 0px;
text-align:center;
}

.editLeft{
width:324px;
height:auto;
padding:0px 0px 0px 0px;
margin:0px 0px 0px 0px;
float:left;
}
.editRight{
width:526px;
height:auto;
padding:0px 0px 0px 0px;
margin:0px 0px 0px 0px;
float:right;
}
.editLeftBox{
width:291px;
height:auto;
padding:0px 0px 0px 33px;
margin:0px 0px 0px 0px;
float:left;
}

.editLeftText{
width:33px;
height:auto;
padding:0px 0px 0px 0px;
margin:0px 0px 0px 0px;
text-align:left;
float:left;
}
.editLeftForm{
width:258px;
height:auto;
padding:0px 0px 0px 0px;
margin:0px 0px 0px 0px;
text-align:left;
float:left;
}

.editRightBox{
width:526px;
height:auto;
padding:0px 0px 0px 0px;
margin:0px 0px 0px 0px;
float:left;
}
.editRightText{
width:74px;
height:auto;
padding:3px 0px 0px 0px;
margin:0px 0px 0px 0px;
text-align:left;
float:left;
}
.editRightForm{
width:452px;
height:auto;
padding:0px 0px 0px 0px;
margin:0px 0px 0px 0px;
text-align:left;
float:left;
}
.editRadio1{
width:24px;
height:auto;
padding:0px 0px 0px 0px;
margin:0px 0px 0px 0px;
text-align:left;
float:left;
}
.editRadio2{
width:50px;
height:auto;
padding:2px 0px 0px 0px;
margin:0px 0px 0px 0px;
text-align:left;
float:left;
}
.editRadio3{
width:24px;
height:auto;
padding:0px 0px 0px 0px;
margin:0px 0px 0px 0px;
text-align:left;
float:left;
}
.editRadio4{
width:50px;
height:auto;
padding:2px 0px 0px 0px;
margin:0px 0px 0px 0px;
text-align:left;
float:left;
}
.editRadio5{
width:100px;
height:auto;
padding:2px 0px 0px 0px;
margin:0px 0px 0px 0px;
text-align:left;
float:left;
}

.editRadioLink1{
width:24px;
height:auto;
padding:0px 0px 0px 0px;
margin:0px 0px 0px 0px;
text-align:left;
float:left;
}
.editRadioLink2{
width:50px;
height:auto;
padding:2px 0px 0px 0px;
margin:0px 0px 0px 0px;
text-align:left;
float:left;
}
.editRadioLink3{
width:24px;
height:auto;
padding:0px 0px 0px 0px;
margin:0px 0px 0px 0px;
text-align:left;
float:left;
}
.editRadioLink4{
width:120px;
height:auto;
padding:2px 0px 0px 0px;
margin:0px 0px 0px 0px;
text-align:left;
float:left;
}
.editRadioLink5{
width:100px;
height:auto;
padding:0px 0px 0px 0px;
margin:0px 0px 0px 0px;
text-align:left;
float:left;
}



.editItemPrice1{
width:14px;
height:auto;
padding:3px 0px 0px 0px;
margin:0px 0px 0px 0px;
text-align:left;
float:left;
}
.editItemPrice2{
width:100px;
height:auto;
padding:0px 0px 0px 0px;
margin:0px 0px 0px 0px;
text-align:left;
float:left;
}

.editSize1{
width:266px;
height:auto;
padding:0px 0px 0px 0px;
margin:0px 0px 0px 0px;
text-align:left;
float:left;
}
.editSize2{
width:24px;
height:auto;
padding:0px 0px 0px 0px;
margin:0px 0px 0px 0px;
text-align:left;
float:left;
}
.editSize3{
width:40px;
height:auto;
padding:2px 0px 0px 0px;
margin:0px 0px 0px 0px;
text-align:left;
float:left;
}
.editSize4{
width:24px;
height:auto;
padding:0px 0px 0px 0px;
margin:0px 0px 0px 0px;
text-align:left;
float:left;
}
.editSize5{
width:40px;
height:auto;
padding:2px 0px 0px 0px;
margin:0px 0px 0px 0px;
text-align:left;
float:left;
}
.editSize6{
width:99px;
height:auto;
padding:0px 0px 0px 0px;
margin:0px 0px 0px 0px;
text-align:center;
float:left;
}
.editSize7{
width:33px;
height:auto;
padding:0px 0px 0px 0px;
margin:0px 0px 0px 0px;
text-align:center;
float:left;
}

.editSizeTitle1{
width:266px;
height:auto;
padding:0px 0px 0px 0px;
margin:0px 0px 0px 0px;
text-align:left;
float:left;
}
.editSizeTitle2{
width:128px;
height:auto;
padding:0px 0px 0px 0px;
margin:0px 0px 0px 0px;
text-align:left;
float:left;
}
.editSizeTitle3{
width:99px;
height:auto;
padding:0px 0px 0px 0px;
margin:0px 0px 0px 0px;
text-align:center;
float:left;
}
.editSizeTitle4{
width:33px;
height:auto;
padding:0px 0px 0px 0px;
margin:0px 0px 0px 0px;
float:left;
}
.editSizeLineL{
width:493px;
height:auto;
padding:0px 0px 0px 0px;
margin:0px 0px 0px 0px;
float:left;
}
.editSizeLineR{
width:33px;
height:auto;
padding:0px 0px 0px 0px;
margin:0px 0px 0px 0px;
float:left;
}


.padTop400 { padding-top:400px; }
.padTop300 { padding-top:300px; }
.padTop240 { padding-top:240px; }
.padTop220 { padding-top:220px; }
.padTop200 { padding-top:200px; }
.padTop100 { padding-top:100px; }
.padTop90 { padding-top:90px; }
.padTop80 { padding-top:80px; }
.padTop77 { padding-top:77px; }
.padTop75 { padding-top:75px; }
.padTop70 { padding-top:70px; }
.padTop60 { padding-top:60px; }
.padTop50 { padding-top:50px; }
.padTop47 { padding-top:47px; }
.padTop46 { padding-top:46px; }
.padTop41 { padding-top:41px; }
.padTop40 { padding-top:40px; }
.padTop38 { padding-top:38px; }
.padTop37 { padding-top:37px; }
.padTop36 { padding-top:36px; }
.padTop35 { padding-top:35px; }
.padTop33 { padding-top:33px; }
.padTop32 { padding-top:32px; }
.padTop31 { padding-top:31px; }
.padTop30 { padding-top:30px; }
.padTop29 { padding-top:29px; }
.padTop28 { padding-top:28px; }
.padTop27 { padding-top:27px; }
.padTop24 { padding-top:24px; }
.padTop23 { padding-top:23px; }
.padTop22 { padding-top:22px; }
.padTop20 { padding-top:20px; }
.padTop19 { padding-top:19px; }
.padTop18 { padding-top:18px; }
.padTop17 { padding-top:17px; }
.padTop16 { padding-top:16px; }
.padTop15 { padding-top:15px; }
.padTop14 { padding-top:14px; }
.padTop13 { padding-top:13px; }
.padTop12 { padding-top:12px; }
.padTop11 { padding-top:11px; }
.padTop10 { padding-top:10px; }
.padTop9 { padding-top:9px; }
.padTop8 { padding-top:8px; }
.padTop7 { padding-top:7px; }
.padTop6 { padding-top:6px; }
.padTop5 { padding-top:5px; }
.padTop4 { padding-top:4px; }
.padTop3 { padding-top:3px; }
.padTop2 { padding-top:2px; }
.padTop1 { padding-top:1px; }


a:visited {
text-decoration: none;
color: #879cc3;
}

a:link {
text-decoration: none; 
color: #879cc3;
}
a:hover {
text-decoration: underline;
color: #879cc3;
}
a:active {
text-decoration: none;
color: #879cc3;
}

a.black:link {color: #575757; text-decoration: none;}
a.black:visited {text-decoration: none; color: #575757;}
a.black:hover {text-decoration: underline; color: #879cc3;}
a.black:active {text-decoration: none; color: #879cc3;}

a.black_on:link {color: #000000; text-decoration: none;}
a.black_on:visited {text-decoration: none; color: #000000;}
a.black_on:hover {text-decoration: underline; color: #879cc3;}
a.black_on:active {text-decoration: none; color: #000000;}




input.order1Form1{
width:166px;
height:auto;
font-size:11px;
background-color: #ffffff;
border: solid 1px; 
border-color: #c3c3c3;
}
input.coupon2Form1{
width:200px;
height:auto;
font-size:11px;
background-color: #ffffff;
border: solid 1px; 
border-color: #c3c3c3;
}
input.coupon2Form2{
width:40px;
height:auto;
font-size:11px;
background-color: #ffffff;
border: solid 1px; 
border-color: #c3c3c3;
}
input.shippingForm1{
width:40px;
height:auto;
font-size:11px;
background-color: #ffffff;
border: solid 1px; 
border-color: #c3c3c3;
}
input.newsUpFile{
width:245px;
height:auto;
font-size:11px;
background-color: #ffffff;
border: solid 1px; 
border-color: #c3c3c3;
}
input.newsEditForm01{
width:418px;
height:auto;
font-size:11px;
background-color: #ffffff;
border: solid 1px; 
border-color: #c3c3c3;
}
input.newsEditForm02{
width:73px;
height:auto;
font-size:11px;
background-color: #ffffff;
border: solid 1px; 
border-color: #c3c3c3;
}
textarea.newsEditForm03{
width:418px;
height:240px;
font-size:11px;
background-color: #ffffff;
border: solid 1px; 
border-color: #c3c3c3;
}

input.itemEditForm01{
width:418px;
height:auto;
font-size:11px;
background-color: #ffffff;
border: solid 1px; 
border-color: #c3c3c3;
}
input.itemEditForm02{
width:200px;
height:auto;
font-size:11px;
background-color: #ffffff;
border: solid 1px; 
border-color: #c3c3c3;
}
textarea.itemEditForm03{
width:418px;
height:240px;
font-size:11px;
background-color: #ffffff;
border: solid 1px; 
border-color: #c3c3c3;
}
input.itemEditForm04{
width:73px;
height:auto;
font-size:11px;
background-color: #ffffff;
border: solid 1px; 
border-color: #c3c3c3;
}

hr {
border-top:none;
border-bottom: 1px dashed #A5AEC5;
}

 

bg04 is a grey line gif I've atached it too

It is a strange way to give your table a border, but I suppose a quick fix would be to change this:

        <table width="850" border="0" cellspacing="0" cellpadding="0">

 

To:

        <table width="800" align="center" border="0"  cellspacing="0" cellpadding="0">

Thats put the Select in the right place now all I need is to have the dotted line go from the Select to the Product No. At present the dotted line starts at Product num.

 

(I KNOW ITS NOT PHP NOW BUT IM SO CLOSE!!! LOL)

 

Ive attached current screenshot

Archived

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

×
×
  • 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.