Jump to content

Recommended Posts

hi i was hoping for a little help please.

 

I have created a recordset that is echoed in a table on a page This is the code used to create it:

 

<?php

 

echo"<table width=\"200\" border=\"0\" class=\"border_bottom\"> \n";

echo "<tr> \n";

 

  echo "<td> </td> \n";

  echo "</td> \n";

  echo "</tr> \n";

  echo "<tr> \n";

    echo "<td>"; echo "<strong>Client Name</strong>"; echo "</td>";

    echo "<td align=\"left\">"; ?>

  <em><a href="search_client_details.php?recordID=<?php echo $result['Client']; ?>"><?php echo $result['Client']; ?> </a></em> <?php echo " </td> \n";

  echo "</tr> \n";

  echo "<tr> \n";

 

  echo "<td>"; echo "<strong>Department Code</strong>"; echo "</td>";

      echo "<td>"; echo "<em>"; echo $result['DepartmentCode']; echo "</em>"; echo "</td>";

   

  echo "</tr> \n";

 

  echo "<tr> \n";

  echo "<td> </td> \n";

  echo "</td> \n";

  echo "</tr> \n";

  echo  "<br>";

 

echo "</table> \n";

 

 

 

See attached screen print of what it looks like on page.

 

The problem is that the Client names and Department code data fileds are NOT all flush in line!!!!! I have tried editing the above code to align=\"left\".... to the table bit at beginning...all this did is change the records from displaying DOWN the page to a ACROSS page. I then tried adding echo "<br>"; at end of it so each record would one above the other going down page - this doesnt do anything!

 

Finally i tried to add the align=\"left\" code the the actual <td> bit of code....

 

E.G.

 

echo "<td align\="left\";

 

 

This also doesnt do anything......

 

So basically i want the right hand column of records to be in line (flush) from left to right!

 

Can somebody help me please>???

 

Thanks :)

 

 

 

[attachment deleted by admin]

Link to comment
https://forums.phpfreaks.com/topic/51985-solved-echo-table-align-left/
Share on other sites

Hi,

 

 

Sory i uploaded word doc with screen print on, but no virus i can assure you....

 

 

Thanks for reply thats brilliant, worked a charm!! I found that with what you said a long with giving the 2nd columns a TD WIDTH of it worked a charm.

 

Thanks very much indeed......

 

Incidently what whould i add if i wanted to valign the text to TOP as well as align left.....???????

 

Many thanks again :)

 

kind Regards

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.