GIDForums  

Go Back   GIDForums > Computer Programming Forums > MySQL / PHP Forum
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 20-Jan-2005, 09:51
rams rams is offline
New Member
 
Join Date: Jan 2005
Posts: 10
rams is on a distinguished road

Table Size


The following is working great, but I need the table to be smaller. I know this should be easy, but I'm not having any luck. Any help will be greatly appreciated. Thanks.

PHP Code:

<html>
<head>
<title>Line 1 Temperatures</title>
</head>

<body>
<table width="300" cellpadding="5" cellspacing="0" border="2">
<tr align="center" valign="top">
<td align="left" colspan="1" rowspan="1" bgcolor="64b1ff">

<form method="POST" action="insert_temp.php">
<!--The hidden fields are provided to maintain state.  They are used to pass the username and password from script to script.-->
<input type="hidden" name="username" value="<? print $_POST['test']?>">
<input type="hidden" name="password" value="<?print $_POST['test']?>">


<?
$Date = date("Y-m-d");



 print("<table align=center size=2 border=1>");
    print("<tr>");
    print("<td><font size = 2 font style='FONT-WEIGHT:BOLD'>Date:</font></td>");
    print("<td><font size = 2 font style='FONT-WEIGHT:BOLD'>Room:</font></td>");
    print("<td><font size = 2 font style='FONT-WEIGHT:BOLD'>Pot:</font></td>");
    print("<td><font size = 2 font style='FONT-WEIGHT:BOLD'>Temp:</font></td>");
    print("</tr>");

 $section=$_POST['section'];

 if ($section == A1_21) {
    $start = 1;
        $end = 21;
    $room = A; 
 } elseif ($section == A22_43) {
        $start = 22;
    $end = 43;
    $room = A;
 } elseif ($section == A44_65) {
    $start = 44;
    $end = 65;
    $room = A;
 } elseif ($section == A66_87) {
    $start = 66;
    $end = 87;
    $room = A; 
 } elseif ($section == B1_21) {
    $start = 1;
        $end = 21;
    $room = B; 
 } elseif ($section == B22_43) {
        $start = 22;
    $end = 43;
    $room = B;
 } elseif ($section == B44_65) {
    $start = 44;
    $end = 65;
    $room = B;
 } elseif ($section == B66_87) {
    $start = 66;
    $end = 87;
    $room = B;
 } else {

    exit("Please select a section");
 
 }


    for ($Loop = $start; $Loop <=$end; $Loop++)
        {
          print("<tr>");
            print("<td>" .$Date. "</td>");
        
              print("<td>$room</td>");
            
            print("<td>" .$Loop. "</td>");
            print("<td><input type=text name='Temp[]' size=3 maxlength=4></td>");
            print("</tr>");
        }

            print("</table><br>");

 
        
    print "<input type=submit value=Submit><input type=reset>\n";
?>

<input type="hidden" name="ud_section" value="<? echo "$section"?>"><br>


</form>
</td>
</tr>
</table>
</body>
</html> 

  #2  
Old 20-Jan-2005, 23:51
WaltP's Avatar
WaltP WaltP is offline
Outstanding Member
 
Join Date: Feb 2004
Location: Midwest US
Posts: 3,234
WaltP is a name known to allWaltP is a name known to allWaltP is a name known to allWaltP is a name known to allWaltP is a name known to allWaltP is a name known to all
Change
<table width="300" cellpadding="5" cellspacing="0" border="2">
to
<table width="250" cellpadding="5" cellspacing="0" border="2">
__________________

Cow: You're a lawyer too?
Mooseblood (mosquito): Ma'am, I was already a bloodsucking parasite. All I needed was a briefcase!
  #3  
Old 21-Jan-2005, 06:19
rams rams is offline
New Member
 
Join Date: Jan 2005
Posts: 10
rams is on a distinguished road
I'll try it out, thanks for your help.
  #4  
Old 22-Jan-2005, 03:52
dopee dopee is offline
Awaiting Email Confirmation
 
Join Date: Feb 2004
Location: south africa
Posts: 109
dopee will become famous soon enough
making a script for a greenhouse or grow room?
 

Recent GIDBlog2nd Week of IA Training by crystalattice

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Hash Table & Graph Kay Chan CPP / C++ Forum 7 08-Oct-2004 07:44
Having a problem Chuckles Computer Hardware Forum 19 13-Sep-2004 12:17
array size oshiotse C Programming Language 3 01-May-2004 04:46
Re: Programming Techniques WaltP C Programming Language 0 09-Mar-2004 23:56
[Tutorial] MySQL Basics nniehoff MySQL / PHP Forum 15 23-Mar-2003 19:42

Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 16:28.


vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.