In: Computer Science
PLEASE WRITE SIMPLE HTML ,CSS(IF REQUIRED) , JAVASCRIPT(IF REQUIRED)
PLEASE TELL HOW TO BRING THE EXTRA SCROLL BAR MENU ATTACHED WITH THE TABLE . I WANT TO BRING THE SCROLL BAR JUST ATTACHED WITH THE EXTREME END OF THE TABLE COLUMN . I DO NOT WANT THE SCROLL BAR TO APPEAR AT THE EXTREME END OF THE PAGE.
Also i want the scroll bar menu to be horizontal and vertical as well.
Also the table column values and all the rows values data are getting disorganized. In MS EXCEL we directly select each column values and align center so that all the text is properly aligned.
i want to know how to the proper alignment of all the table column values as well.
i am posting one link for reference and help but my entire problem was not solved hence posting it again.
https://www.chegg.com/homework-help/questions-and-answers/please-write-simple-html-css-required-javascript-required-please-tell-bring-extra-scroll-b-q43754597?trackid=HHHR8JIP
I have used HTML and CSS codes .
Html Code :
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>JS Bin</title>
</head>
<body>
<table border=1px width=170px height=200px>
<tr>
<th width=50%><div class=scrollable>
<style>
table, th, td {
border: 1px solid black;
padding: 2px;
}
</style>
</head>
<body>
<table >
<tr>
<th>Months</th>
<th>Savings</th>
</tr>
<tr>
<td>January</td>
<td>100$</td>
</tr>
<tr>
<td>January</td>
<td>100$</td>
</tr>
<tr>
<td>January</td>
<td>100$</td>
</tr>
<tr>
<td>January</td>
<td>100$</td>
</tr>
<tr>
<td>January</td>
<td>100$</td>
</tr>
<tr>
<td>January</td>
<td>100$</td>
</tr>
<tr>
<td>January</td>
<td>100$</td>
</tr>
<tr>
<td>January</td>
<td>100$</td>
</tr>
<tr>
<td>January</td>
<td>100$</td>
</tr>
<tr>
<td>January</td>
<td>100$</td>
</tr>
<tr>
<td>January</td>
<td>100$</td>
</tr>
<tr>
<td>January</td>
<td>100$</td>
</tr>
<tr>
<td>January</td>
<td>100$</td>
</tr>
<tr>
<td>January</td>
<td>100$</td>
</tr>
<tr>
<td>January</td>
<td>100$</td>
</tr>
<tr>
<td>January</td>
<td>100$</td>
</tr>
<tr>
<td>January</td>
<td>100$</td>
</tr>
<tr>
<td>January</td>
<td>100$</td>
</tr>
</table>
</div></th>
</tr>
</table>
</body>
</html>
CSS Code:
div.scrollable {
width: 100%;
height: 100%;
margin: 0;
padding: 0;
overflow: auto;
}
This is the solution for the given problem, it is as per my knowledge. I hope you accept this as answer.