У меня есть следующая функция:
public function createRatingButtons(){
for($count=1;$count<=5;$count++){
echo "<button onclick=''><b>$count</b></button> ";
}
}
Приведенная выше функция просто создает 5 отдельных кнопок с метками 1, 2, 3, 4 и 5!
Я звоню вышеФункция ниже:
public function displayGrades($student,$unit){
$studentID = $this->getStudentID($student);
$unitID = $this->getUnitID($unit);
$obj = new dbConfig();
$obj->dbConnect();
$sql="SELECT * FROM grading where studentID = '$studentID' && unitID = '$unitID'";
$result = mysqli_query($obj->conn,$sql) or die(mysqli_error($sql));
$row = mysqli_fetch_assoc($result);
echo "
<table>
<tr>
<td>Independence</td>
</tr>
<tr>
<td>Current Rating: " . $row['independence'] . "</td>
</tr>
<tr>
<td>" . $this->createRatingButtons() . "</td>
</tr>
<tr>
<td>Participation</td>
</tr>
.
.
.
ПРОБЛЕМА: Отображает кнопки, но они не отображаются в том столбце, где я вызвал функцию.Кнопки появляются над таблицей.Я хочу, чтобы они отображались в том же столбце, где я вызываю функцию.
Как мне решить эту проблему?Пожалуйста, кто-нибудь может помочь.Заранее спасибо