Jump to content

Trouble Displaying/formating Data In A Table (Help)


Chezshire

Recommended Posts

I'm attempting to set display some data pulled from the database and present it in a table so i can get everything to line up correctly. When I attempt to form a table around it, the content hops out of the table or part of it does not display.

 

 

Working on the first row, it currently displays 'CITIZENSHIP: USA' //if ($citizenship) { echo "<strong>CITIZENSHIP:</strong> $citizenship";

 

If I try this, it displays 'USA', the citizenship 'vanishes'.

//if ($citizenship) { echo "<tr>

// <td align=\"right\" valign=\"top\"><p><strong>CITIZENSHIP:</strong></p></td>

// <td width=\"10\"> </td>

// <td valign=\"top\"><p>" . $citizenship . "</p>

// </td></tr>";

 

 

<table cellpadding=\"0\" cellspacing=\"0\">
<?php //if ($citizenship) { echo "<tr> //	 <td align=\"right\" valign=\"top\"><p><strong>CITIZENSHIP:</strong></p></td> //	 <td width=\"10\"> </td> //	 <td valign=\"top\"><p>" . $citizenship . "</p> // 	 </td></tr>"; if ($citizenship) { echo "<strong>CITIZENSHIP:</strong> $citizenship"; if ($legalstatus) { echo ", $legalstatus"; } echo "<br >\n"; } else if ($legalstatus) { echo "<strong>Legal Status:</strong> $legalstatus"; } // end legal status if ($type=="administrator" || $type=="alumni" || $type=="faculty" || $type=="staff" || $type=="student") { $theseFields = array("placeofbirth", "maritalstatus", "occupation", "affiliation"); } else { $theseFields = array("placeofbirth", "maritalstatus", "occupation", "affiliation", "baseofoperations"); } // end if resident foreach ($theseFields as $thisField) { if (${$thisField}) { echo "<strong>" . ${$thisField . "Name"} . ":</strong> "; echo ${$thisField};
if (isset(${"former" . $thisField})) {
if (${"former" . $thisField}) { echo " (formerly " . ${"former" . $thisField} . ")"; } } // end if set
} // end if info } // end FOREACH if ($type=="administrator" || $type=="alumni" || $type=="faculty" || $type=="staff" || $type=="student") { ?>

</table>

 

 

 

 

ANy help would be greatly appreciated. I'm very much a newb.

Thanks to anyone kind enough to try to help me with this. I've been struggling with this all day and i really thought it'd tage a few minutes.

 

Thanks

Edited by Chezshire
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.