문제

I am very new to PHP and html, for school I need to make a website that calculates monetary exchange rates.

Now for the calculator itself everything works. But to make it look more professional I added a table with borders etc. Then I added a table header on top but I also want to put one on the left side of my table. I just can't figure out where to put what.

This is my code so far (probably contains many mistakes. just ignore them, this is only for the table.)

<?php

if(!empty($_POST['submit']))
{

$valuta=$_POST['valuta'];
$wisselkoers=$_POST['wisselkoers'];

echo "<table border=1px>";
echo "<th>0</th><th>1</th><th>2</th><th>3</th><th>4</th><th>5</th><th>6</th><th>7</th><th>8</th><th>9</th>";

for($tiental=0; $tiental<100; $tiental=$tiental+10)
{

    echo "<tr>";
    for($eenheden=0; $eenheden<10; $eenheden=$eenheden+1)
    {
        $uitkomst = ($tiental+$eenheden)* $wisselkoers;

        echo"<td> ".$uitkomst."</td>";
    }
    echo"</tr>";
}
echo"</table>";

}
// (HTML after this)
도움이 되었습니까?

해결책

<?php

if(!empty($_POST['submit']))
{

$valuta=$_POST['valuta'];
$wisselkoers=$_POST['wisselkoers'];

echo "<table border=1px>";
echo "<tr><th>0</th><th>1</th><th>2</th><th>3</th><th>4</th><th>5</th><th>6</th><th>7</th><th>8</th><th>9</th><th>10</th></tr>";

for($tiental=0; $tiental<100; $tiental=$tiental+10)
{

echo "<tr><th>HEADER LEFT SIDE CONTENT</th>";
for($eenheden=0; $eenheden<10; $eenheden=$eenheden+1)
{
    $uitkomst = ($tiental+$eenheden)* $wisselkoers;

    echo"<td> ".$uitkomst."</td>";
}
echo"</tr>";
}
echo"</table>";

}

I hope this is usefull.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top