Do you want the horizontal scroll bar in the DIV and not in the browser? If so then the code above works for me in IE6 and Firefox 1.5. Try changing overflow: auto; to overflow: scroll; or overflow: visible;
Dan
Main Topics
Browse All TopicsHi all,
I want to create a table that has a long width because I want to show as many as columns that I want. So I want to make my table width as big as I can but I don't want to see a horizontal of my main page. I want to make a horizontal in my table only. I use the code below :
<DIV style="overflow:auto;width
<table width=100%>
<tr>
.....
</table>
</DIV>
I want my DIV show horizontal only.
Thanks.
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Business Accounts
Answer for Membership
by: sajuksPosted on 2006-02-17 at 01:38:24ID: 15978847
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html 4/strict.d td">
<html>
<head>
<title>Credit to GrandSchtroumpf for this example</title>
<style type="text/css">
div#scroll {
height: 100px;
width: 100%;
overflow: auto;
background: gold;
color: black;
}
div#scroll table {
table-layout: fixed;
width: 1200px;
border-collapse: collapse;
}
div#scroll th,
div#scroll td {
width: 300px;
text-align: left;
}
</style>
</head>
<body>
<div id="scroll" >
<div>
<table>
<thead>
<tr>
<th>Column 1</th>
<th>Column 2</th>
<th>Column 3</th>
<th>Column 4</th>
</tr>
</thead>
<tbody>
<tr>
<td>Column 1 Value</td>
<td>Column 2 Value</td>
<td>Column 3 Value</td>
<td>Column 4 Value</td>
</tr>
<tr>
<td>Column 1 Value</td>
<td>Column 2 Value</td>
<td>Column 3 Value</td>
<td>Column 4 Value</td>
</tr>
<tr>
<td>Column 1 Value</td>
<td>Column 2 Value</td>
<td>Column 3 Value</td>
<td>Column 4 Value</td>
</tr>
</tbody>
</table>
</div>
</div>
</body>
</html>