Click here to Skip to main content
15,920,111 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi I cant get this to align right

can someone help?

What I have tried:

 $i = 0;
while($i < $count) {
  echo '<tr>';
  if(isset($arr['BoysName'][$i])) { echo '<td>'. $arr['BoysName'][$i] . '<button align="right" class="favourites" id="' . $arr['BoysName'][$i] . '" value="' . $dbRow["UserID"] . '<div style="float:right;">♥</div></button></td>'; }
  else{ echo '<td class="noBorder"> </td>'; }
  if(isset($arr['GirlsName'][$i])) { echo '<td>'.$arr['GirlsName'][$i] . '<button class="favourites" id="' . $arr['GirlsName'][$i] . '" value="' . $dbRow["UserID"] . '">♥</button></td>'; }
  else{ echo '<td class="noBorder"> </td>'; }
  echo '</tr>';
  $i++;
}
echo '</table></center>';
}
Posted
Updated 13-Feb-18 4:34am
Comments
ZurdoDev 13-Feb-18 10:20am    
Use your developer tools to see what the actual html looks like and figure it out from there. Just some simple debugging and effort will get this resolved soon.
Richard Deeming 13-Feb-18 12:45pm    
REPOST
You've seriously forgotten the answer since Sunday?!
https://www.codeproject.com/Questions/1229561/Align-right-not-working[^]
Member 13637584 14-Feb-18 4:38am    
My code has changed now from before this richard. tried it and doesnt work like before.

1 solution

Look like there is a typos in the code, missing > in the button. And there could be issue with the secret class "favourites".

Should be
HTML
<button ...> your other element </button>

and not
HTML
<button ... your other element </button>


Here is an example based on the posted code (sort of)
cp_image_btn_not_allign - JSFiddle[^]
 
Share this answer
 
v3

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900