无法获取表以包含所有查询结果

I'm trying to get the table to encompass all the results returned from my query. For some reason, it only creates a new row for the first record. How can I get it to create rows for the rest of them?picture of output

<table border="2px" bgcolor="#FFFFFF" >
            <tr>
            <th bgcolor="#c6c6c6" width="115px"> <p text-align="middle"> Region </p> </th>
            <th bgcolor="#c6c6c6" width="115px"> <p text-align="middle"> Sales </p> </th>
    </tr>
    <? while($rowR = mysqli_fetch_array($resultR)){ ?>
            <tr>
                <td> <?php echo $rowR['0'] ;?> </td>
                <td> <?php echo $rowR['1'] ;?> </td>
    </tr>
    </table>
    <? } ?>

Place your end bracket <? } ?> for the array loop after the </tr> element.

By putting it after the </table> element, you're closing your table each time your while loop iterates.

<? while($rowR = mysqli_fetch_array($resultR)){ ?>
  <tr>
    <td> <?php echo $rowR['0'] ;?> </td>
    <td> <?php echo $rowR['1'] ;?> </td>
  </tr>
<? } ?>
</table>