I am currently tackling a project that involves generating a PDF file from HTML. However, I have encountered an issue where the table exceeds the page width. As a result, I am seeking a solution to display this table vertically.
Is there a way to achieve this using HTML/CSS (I am utilizing Bootstrap 4)? Please refer to the provided source code and images below:
Source Code:
<!DOCTYPE html>
<html>
<head>
<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" rel="stylesheet" />
</head>
<body>
<table class="table">
<thead>
<tr>
<th>#</th>
<th>First Name</th>
<th>Last Name</th>
<th>Username</th>
</tr>
</thead>
<tbody>
<tr>
<th scope="row">1</th>
<td>Mark</td>
<td>Otto</td>
<td>@mdo</td>
</tr>
<tr>
<th scope="row">2</th>
<td>Jacob</td>
<td>Thornton</td>
<td>@fat</td>
</tr>
<tr>
<th scope="row">3</th>
<td>Larry</td>
<td>the Bird</td>
<td>@twitter</td>
</tr>
</tbody>
</table>
</body>
</html>
Current Output:
https://i.sstatic.net/8zUTU.png
Desired Outcome:
https://i.sstatic.net/RrvIc.png
Thank you for your assistance