I am trying to give min-width to table cell and want horizontal scrolling but min-width is not working here,can anyone please help? I have seen this comment also on stack overflow but it is not solving my problem.
Code is this :
<!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">
<title>Document</title>
</head>
<style>
div{
width: 50%;
overflow-x: scroll;
border: 1px solid red;
}
table{
table-layout: fixed;
border: 1px solid black;
width: 100%;
}
th,td{
border: 1px solid black;
min-width: 1000px;
}
</style>
<body>
<div>
<table>
<tr>
<th>nb b </th>
<th>agahbajh gae</th>
<th>nbb </th>
<th>agahajh gae</th>
</tr>
<tr>
<td>amame ban</td>
<td>20</td>
<td>amame ban</td>
<td>20</td>
</tr>
<tr>
<td>aahshu</td>
<td>23</td>
<td>aaajshu</td>
<td>23</td>
</tr>
</table>
</div>
</body>
</html>
Update:- As my question has been answered by @Emaro. Now i want to know that what if i want to give width to 4 col. as :- 40%,40%,50%,50% of outer div.
Thanks