<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous">
    <title>Document</title>
</head>
<body>
    <nav class="navbar navbar-dark bg-dark">
        <a href="#" class="navbar-brand mx-auto">NEWS</a>
    </nav>
   <div class="container">
        <div class="row">
            <div class="col-md-6 mt-4">
                <table class="table table-striped">
                    <tr>
                        <th>ID</th>
                        <th>TITLE</th>
                        <th>NEWS</th>
                    </tr>
                        <% for(var i = 0 ; i < news.length; i++){%> 
                        <tr>
                            <td><%= news[i].id_news%></td>
                            <td><%= news[i].title%></td>
                            <td><%= news[i].news%></td>
                        </tr>
                        <%}%>
                </table>
            </div>

            <div class="col-md-6 mt-4 card">
                <form action="/news" method="post" class="card-body">
                    <h3 class = card-title>Add News</h3>
                    <div class=" form-group">
                        <input type="text" name="title" class="form-control" placeholder="Title">
                    </div>
                    <div class="form-group">
                        <input type="text" name="news" class="form-control" placeholder="Content">
                    </div>
                    <input type="submit" class="btn btn-primary">

                </form>
            </div>
        </div>
   </div> 
   
    
   <script>
    document.getElementById('title'.focus)
   </script>
    
</body>
</html>