Position tables with commands in php

Asked

Viewed 81 times

1

I’m doing a program that creates variables, and shows them in two tables with a echo. Together in that echo, i put a table with a style inside. However, when testing the code, the formatting does not apply.

echo
'<table style="postion:absolute; right:100px;" border="1">
<tr><td>Weapon</td><td>'.$weapon.'</td></tr>
<tr><td>Armor</td><td>'.$armor.'</td></tr>
</table><br><br>    
';
echo
'<table style="postion:absolute; left:100px;""border="1">
<tr><td>Ouro</td><td>'.$money.'</td></tr>
<tr><td>Name</td><td>'.$name.'</td></tr>
<tr><td>Health</td><td>'.$health.'</td></tr>
<tr><td>Mana</td><td>'.$mana.'</td></tr>
<tr><td>Dextery</td><td>'.$dextery.'</td></tr>
<tr><td>Defense</td><td>'.$defense.'</td></tr>
<tr><td>Damage</td><td>'.$damage.'</td></tr>
<tr><td>Range</td><td>'.$distance.'</td></tr>
</table><br><br>    
';


Since I haven’t used css in a while, I’m a little rusty, so I don’t know what I should do to fix this problem.

1 answer

1


The problem is that you wrote the wrong CSS property!

Ve wrote postion:absolute;, the word postion is wrong, missed a i after the s

The correct is pos**i**tion

position:absolute;

Besides here you left one " leftover, style="postion:absolute; left:100px;""border="1". You have to take that Quotes " before the border="1"

Your corrected code

<table style="position:absolute; right:100px;" border="1">
  <tr>
    <td>Weapon</td>
    <td>'.$weapon.'</td>
  </tr>
  <tr>
    <td>Armor</td>
    <td>'.$armor.'</td>
  </tr>
</table>

<br><br>

<table style="position:absolute; left:100px;" border="1">
  <tr>
    <td>Ouro</td>
    <td>'.$money.'</td>
  </tr>
  <tr>
    <td>Name</td>
    <td>'.$name.'</td>
  </tr>
  <tr>
    <td>Health</td>
    <td>'.$health.'</td>
  </tr>
  <tr>
    <td>Mana</td>
    <td>'.$mana.'</td>
  </tr>
  <tr>
    <td>Dextery</td>
    <td>'.$dextery.'</td>
  </tr>
  <tr>
    <td>Defense</td>
    <td>'.$defense.'</td>
  </tr>
  <tr>
    <td>Damage</td>
    <td>'.$damage.'</td>
  </tr>
  <tr>
    <td>Range</td>
    <td>'.$distance.'</td>
  </tr>
</table>
<br><br>

Browser other questions tagged

You are not signed in. Login or sign up in order to post.