Jump to content

[SOLVED] Echo table align left


yandoo

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

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.