테이블이 있고 div의 높이까지만 테이블이 표시되도록 스크롤 할 수 있도록 div에 넣고 싶습니다. 나머지 테이블을 볼 수 있습니다. 내부 테이블이 부분적으로 숨겨져 스크롤 될 수 있도록 div 스타일을 지정하는 방법
#listTimes {
margin-right: 0;
height: 100px;
}
#timesList table {
border-collapse: collapse;
margin: 0 auto;
right: 0;
left: 0;
}
#timesList table, td, th {
border: 1px solid black;
padding: 5px;
}
#timesList th {
text-align: left;
}
#session {
border-radius: 5px 5px 0 0;
height: 10px;
width: 20%;
margin: 0 auto;
}
<html>
<body>
<div class="listTimes">
<form id="session">
\t <select name="sessions" onchange="showUser(this.value)">
\t <option value="1">Session 1</option>
\t <option value="2">Session 2</option>
\t <option value="3">Session 3</option>
\t <option value="4">Session 4</option>
\t <option value="5">Session 5</option>
\t </select>
\t </form>
\t <br>
\t <div id="timesList">
<!-- This is where the table is -->
<table>
<tr>
<th>No.</th>
<th>foo</th>
<th>bar</th>
</tr>
<tr>
<th>1</th>
<th>fubar</th>
<th>lnrbaaet</th>
</tr>
</table>
\t </div>
\t </div>
</div>
</body>
</html>
당신이 말해 주시겠습니까? – Cubetastic
@Cubetastic Updated. ':: - webkit-scrollbar {display : none;} '을 사용할 수는 있지만, Firefox 나 Edge에서 지원되는지 모르겠습니다 ... – sol
'padding-right : 20px; margin-right : -20px;'작동하지 않는다. 단지 스크롤바의 위치를 바꾼다. Z-Index를 낮출 수있는 방법이 있습니까? 그리고 :: :: webkit-scrollbar {display : none;}는 크롬에서는 작동하지만 파이어 폭스에서는 작동하지 않습니다. – Cubetastic