addressalign-toparrow-leftarrow-rightbackbellblockcalendarcameraccwcheckchevron-downchevron-leftchevron-rightchevron-small-downchevron-small-leftchevron-small-rightchevron-small-upchevron-upcircle-with-checkcircle-with-crosscircle-with-pluscontroller-playcrossdots-three-verticaleditemptyheartexporteye-with-lineeyefacebookfolderfullheartglobegmailgooglegroupshelp-with-circleimageimagesinstagramFill 1light-bulblinklocation-pinm-swarmSearchmailmessagesminusmoremuplabelShape 3 + Rectangle 1ShapeoutlookpersonJoin Group on CardStartprice-ribbonprintShapeShapeShapeShapeImported LayersImported LayersImported Layersshieldstartickettrashtriangle-downtriangle-uptwitteruserwarningyahoo

Re: [php-49] Malformed Table Madness... (in that the table is driving me mad like Cthulu)

From: max s.
Sent on: Wednesday, November 21, 2012 1:59 AM
Uhm... I figured it out about 5 minutes after I asked for help. It's a thanksgiving miracle!

Thank yuo and sorry for the spammage folks.
On Nov 21, 2012, at 1:28 AM, max steinmetz wrote:

> Hello Guys,
>   I'm not sure if it's ok for me to ask for help with something here or not. It's late and my mind is crispy like a potato chip (Instead of being crisp). I had some text which i wish to format nice and neatly using a table as I understand tables. Once i get it into a table, i'll propably push it further in to divs, etc. al. But first I need to form a nice clean table. Problem is that an Extra TR and TD tag from which is super malformed.
> 
> I hope ti's ok to ask for help here (i'm very new to PHP and this is a little beyond me. I have tried to solve it but i'm getting lost in where the extra TR and TD are coming form.
> 
> Thanks for any help and if this was bad of me to ask I'm very, very sorry and won't do it again.
> 
> Happy Turkey day
> 
> 
> 
> This is my code: 
> 
> <!-- Now in a table YEAH!!! -->
> <table cellpadding="0" cellspacing="0">	
> 	
> <?php			
> 	if ($citizenship) { echo "<tr> <td class=\"display_td-l­eft\"><p>
> 	<strong>CITIZE­NSHIP:</strong>­</p></td>­ 
> 	<td class=\"display_td-m­iddle\">&nbsp;­</td> 
> 	<td class=\"display_td-r­ight\"><p>$­citizenship";
> 																		  
> 	if ($legalstatus) { echo ", $legalstatus"; }
> 	echo "vvvvvv</p><­/td></tr>";­ // Ends citizenship
> 	} else if ($legalstatus) {
> 	echo "
> 	<tr>
> 		<td class=\"display_td-l­eft\">
> 			<p><strong>­LEGAL STATUS:</strong>­</p></td>­ 
> 		<td class=\"display_td-m­iddle\">&nbsp;­</td> 
> 		<td class=\"display_td-r­ight\"><p>$­legalstatus 2 2 2 </p></td>­
> 	</tr>";
> 	} // end legal status				
> 	
> 	if ($type=="administrat­or" || $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 "<tr>
> 									<td class=\"display_td-l­eft\"\"><p>­<strong>" . ${$thisField . "Name"} . ":</strong><­/p></td> 
> 									<td class=\"display_td-m­iddle\">&nbsp;­</td> 
> 									<td class=\"display_td-r­ight\"><p>";­
> 	echo ${$thisField};
> 	
> 	// Fromerly echos the characters former Occupation - see profile for Arcane for example
> 	// I think thats alumni, nonaffilated,etc.
> 	if (isset(${"former" . $thisField})) { 
> 	
> 	// Fromerly echos the characters former Affiliation - see profile for Arcane for example
> 	if (${"former" . $thisField}) { echo " (formerly " . ${"former" . $thisField} . ")"; }
> 	} // end if set
> 	
> 	// ends the general row!
> 	echo "[masked] </p></td>­</tr>";
> 	} // end if info
> 	} // end FOREACH
> 	
> 	
> 	if ($type=="administrat­or" || $type=="alumni" ||  $type=="faculty" || $type=="staff" || $type=="student") {
> 	
> 
> ?>
> 
> 
> 
> This is the render (With an extra TR and TD tag at the tend that blows the table):
> 	<table cellpadding="0" cellspacing="0">	
> 	<tr>
> 		<td class="display_td-le­ft">
> 			<p>
> 				<strong>CITIZE­NSHIP:</strong>­
> 			</p>
> 		</td> 
> 		<td class="display_td-mi­ddle">&nbsp;<­/td> 
> 		<td class="display_td-ri­ght">
> 			<p>
> 				Residnet Alien, Resident Alienvvvvvv
> 			</p>
> 		</td>
> 	</tr>
> 	<tr>
> 		<td class="display_td-le­ft"">
> 			<p><strong>­PLACE OF BIRTH:</strong>­</p>
> 		</td> 
> 		<td class="display_td-mi­ddle">&nbsp;<­/td> 
> 		<td class="display_td-ri­ght">
> 			<p>Over there[masked] </p>
> 		</td>
> 	</tr>
> 	<tr>
> 		<td class="display_td-le­ft"">
> 			<p><strong>­MARITAL STATUS:</strong>­</p>
> 		</td> 
> 		<td class="display_td-mi­ddle">&nbsp;<­/td> 
> 		<td class="display_td-ri­ght">
> 			<p>Off and On[masked] </p>
> 		</td>
> 	</tr>
> 	<tr>
> 		<td class="display_td-le­ft""><p><­strong>OCCUPATION­:</strong><­/p></td> 
> 		<td class="display_td-mi­ddle">&nbsp;<­/td> 
> 		<td class="display_td-ri­ght"><p>Her­o (formerly waiter[masked] </p>
> 		</td>
> 	</tr>
> 	<tr>
> 		<td class="display_td-le­ft"">
> 			<p><strong>­AFFILIATION:</str­ong></p>
> 		</td> 
> 		<td class="display_td-mi­ddle">&nbsp;<­/td> 
> 		<td class="display_td-ri­ght"><p>JLA­ (formerly Hawks[masked] </p>
> 		</td>
> 	</tr>
> 	<tr>
> 		<td class="display_td-le­ft"">
> 			<p><strong>­BASE OF OPERATIONS:</stro­ng></p>
> 		</td> 
> 		<td class="display_td-mi­ddle">&nbsp;<­/td> 
> 		<td class="display_td-ri­ght">
> 			<p>Hawk Nest[masked] </p>
> 		</td>
> 	</tr>
> 	<tr>
> 		<td>
> 
> 
> 
> 
> 
> 
> 
> 
> 
> --
> Please Note: If you hit "REPLY", your message will be sent to everyone on this mailing list ([address removed])
> http://www.meetup...­
> This message was sent by max steinmetz ([address removed]) from The Seattle PHP Meetup Group.
> To learn more about max steinmetz, visit his/her member profile: http://www.meetup...­
> Set my mailing list to email me
> 
> As they are sent
> http://www.meetup...­
> 
> In one daily email
> http://www.meetup...­
> 
> Don't send me mailing list messages
> http://www.meetup...­
> Meetup, PO Box 4668 #37895 New York, New York[masked] | [address removed]
> 

Our Sponsors

  • PluralSight

    PluralSight subscriptions for developer training

  • O'Reilly

    Disc Code: PCBW is good for 40% off print and 50% off ebooks and videos

  • JetBrains PhpStorm

    Occasional free licenses to raffle off at meetups

  • DynaTrace

    Find yourself, promote yourself, stay true to yourself.

People in this
Meetup are also in:

Sign up

Meetup members, Log in

By clicking "Sign up" or "Sign up using Facebook", you confirm that you accept our Terms of Service & Privacy Policy