Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Fit a 820px table within a 350px div using overflow=scroll 2

Status
Not open for further replies.

southbeach

Programmer
Jan 22, 2008
879
US
I am trying to display a table grid with a width of 820px within a layer set to 350px wide. I have set the overflow to scroll expecting that the table will show neatly fully spread-out.

Instead of a fully spread-out table, the content is getting crunched and the cells are very high

Here is the code
Code:
<style>
div#fileList {
	position: relative;
	top: 0px;
	left: 6px;
	float: left;
	min-height: 360px;
	overflow: scroll;
	width: 350px;
	border: 1px solid red; 
	font-size: 14px;
	padding-left: 6px;
	padding-top: 6px;
	z-index: 2;
}
</style>
<div id="fileList">
	<table with="820px" border="0" cellpadding="0" cellspacing="0">
	<tr>
		<th width="210px">Doc Desc</th>
		<th width="80px">Date</th>
		<th width="80px">Time</th>
		<th width="110px">By</th>
		<th width="60px">AWB</th>
		<th width="60px">Reference</th>
	</tr>
	<tr>
		<td>A brief description for the document.  I am using a small text area to allow user to be as detailed as possible.</td>
		<td>2008-07-21</td>
		<td>2008-07-21 13:27:58</td>
		<td>Mr. Smith</td>
		<td>001-8902-098-01</td>
		<td>4567890-abc</td>
	</tr>
	</table>
</div>

What must I do to get the table to expand thus showing cells at set width?

Thanks!

 
This is why one must step away and come back to your code with a clearer mind. I have been staring at these lines of code for a couple of hours and screaming at my PC waiting for it to say something back ... I now know what it (the PC) was trying to call me which I gracefully ignored. [noevil]

Thank you!
 
This is why one must step away and come back to your code with a clearer mind.
True, but it's also why we keep banging on about the need to validate your code.

A validator would have picked up on the with/width spelling mistake, and a good one would get the px issue too (I'm not sure if the W3C one would have done so). A quick check with the validator can save a lot of screaming time.



-- Chris Hunt
Webmaster & Tragedian
Extra Connections Ltd
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top