измени дизайн страницы код: <?php

require_once 'components/_header.php';
if ($_SESSION['role'] != 'admin') {
    die('<h1>403 Forbidden: access is denied</h1>');
}

$sql = "select * 
        from projects
        left join categories on categories.id = projects.category_id";
$result = $conn->query($sql);
$projects = $result->fetch_all();

$sql = "select * 
        from categories";
$result = $conn->query($sql);
$categories = $result->fetch_all();

?>

<div id="page" class="main-shop">
    <table class="table text-center">
        <thead class="thead-dark">
        <tr>
            <th scope="col">#</th>
            <th scope="col">Заголовок</th>
            <th scope="col">Описание</th>
            <th scope="col">Категория</th>
            <th scope="col">Картинка</th>
            <th scope="col">Обновлено</th>
            <th scope="col">Добавлено</th>
            <th scope="row">-</th>
            <th scope="row">-</th>
        </tr>
        </thead>
        <tbody>
        <tr>
            <form action="requests/create_project.php" method="POST" enctype="multipart/form-data">
                <td>0</td>
                <td>
                    <input required type="text" name="title" class="form-control">
                </td>
                <td>
                    <input type="text" name="description" class="form-control">
                </td>
                <td>
                    <select required class="form-select" name="category_id" aria-label="Default select example">
                        <?php
                        foreach ($categories as $category) {
                            echo "<option value='{$category[0]}'>{$category[1]}</option>";
                        }
                        ?>
                    </select>
                </td>
                <td>
                    <input type="file" name="img" class="form-control">
                </td>
                <td>
                    <input disabled type="text" name="" class="form-control">
                </td>
                <td>
                    <input disabled type="text" name="" class="form-control">
                </td>
                <td>
                    <button class="btn btn-success">Добавить</button>
                </td>
            </form>
        </tr>
        <?php
        $i = 1;
        foreach ($projects as $project) {
            $options = '';
            foreach ($categories as $category) {
                if ($category[0] == $project[4]) {
                    $options .= "<option selected value='{$category[0]}'>{$category[1]}</option>";
                } else {
                    $options .= "<option value='{$category[0]}'>{$category[1]}</option>";
                }
            }
            echo "<form action='requests/update_project.php' method='post' enctype='multipart/form-data'><tr>
                    <td>{$i}</td>
                    <td>
                        <input value='{$project[0]}' hidden type=\"text\" name=\"id\" class=\"form-control\">
                        <input value='{$project[1]}'  type=\"text\" name=\"title\" class=\"form-control\">
                    </td>
                    <td>
                        <input value='{$project[2]}'  type=\"text\" name=\"description\" class=\"form-control\">
                    </td>
                    <td>
                        <select required class=\"form-select\" name=\"category_id\" aria-label=\"Default select example\">
                            $options
                        </select>
                    </td>
                    <td>
                        <input value='{$project[4]}'  type=\"file\" name=\"img\" class=\"form-control\">
                    </td>
                    <td>
                        <input value='{$project[6]}' disabled type=\"text\" name=\"\" class=\"form-control\">
                    </td>
                    <td>
                        <input value='{$project[7]}' disabled type=\"text\" name=\"\" class=\"form-control\">
                    </td>
                    <td>
                        <button type='submit' class=\"btn btn-secondary\">Обновить</button>
                    </td>
                    <td>
                        <a href=\"requests/delete_project.php?project_id={$project[0]}\" class=\"btn btn-danger\">Удалить</a>
                    </td>
                </tr></form>";
            $i += 1;
        }
        ?>
        </tbody>
    </table>
</div>
<?php
require_once 'components/_footer.php';
?>