I have recently designed a card using Bootstrap and I would like to include a table with some data in it.
However, I am facing an issue where the table data spills out of the card when I reduce the screen size for responsiveness testing.
Could someone please provide me with guidance on how to address this problem?
Thank you
.HTML
<div style="width:40%">
<div class="card">
<div class="card-header header">
<h1>My Table</h1>
</div>
<table class="card-table table-borderless myTable" style="overflow-y: auto; overflow-x: auto;">
<thead>
<tr>
<th scope="col tableTitles">Title</th>
<th scope="col tableTitles">Name</th>
<th scope="col tableTitles">ID</th>
<th scope="col tableTitles">Street</th>
</tr>
</thead>
<tbody>
<tr *ngFor="let pr of Data; let a = index;" class="tableColor">
<td class="tableTitles">
{{pr.title}}
</td>
<td class="tableTitles">
{{pr.name}}
</td>
<td class="tableTitles">
{{pr.id}}
</td>
<td class="tableTitles">
{{pr.street}}
</td>
</tr>
</tbody>
</table>
</div>
</div>
.CS
.card {
margin-top: 16px;
margin-left: 16px;
height: 400px;
margin-right: 16px;
background: #FFFFFF 0% 0% no-repeat padding-box;
box-shadow: 0px 3px 20px #BCBCCB47;
border-radius: 8px;
opacity: 1;
border: 2px solid red;
}
.header {
width: 100%;
height: 40px;
background: #ECF2F9 0% 0% no-repeat padding-box;
border-radius: 8px 8px 0px 0px;
}
.header h1 {
text-align: center;
font-family: 'Noto Sans', sans-serif;
font-size: 14px;
letter-spacing: 0;
color: #4D4F5C;
}
Problem