943,704 Members | Top Members by Rank

Ad:
Apr 17th, 2007
0

css div's and tables table cells and scrolling

Expand Post »
I have a webpage and in my html the container holds the sidebars and the content2 I have put a 3columnX8row table instead of a million <div>s I was wondering how I could make the data cells scroll vertically in my css intead of a million <div>s. well actually 12 <div>s.
this may look crazy, but I'm just learning
#container {
font-family: Arial, Helvetica, Verdana, Sans-serif;
float: right;
width: 640px;
margin: 0 auto;
}
#sidebar-a {
float: right;
width: 120px;
line-height: 18px;
border-left: 1px solid #efefef;
}
#sidebar-a .padding, #sidebar-b .padding, #sidebar-c .padding {
padding: 0;
}
#sidebar-b, #sidebar-c {
clear: right;
float: right;
width: 120px;
line-height: 18px;
border-left: 1px solid #efefef;
}
#content2 {
float: left;
width: 507px;
border-left: 1px solid #efefef;
border-right: 1px solid #efefef;
border-bottom: 1px solid #efefef;
}
#content2 caption {
font-size: 24px;
font-weight: bold;
padding-top: 10px;
padding-bottom: 10px;
border-bottom: 1px solid #efefef;
}
table {
height: auto;
border: collapse;
width: auto;
}
td {
width: 33%;
text-align: center;
border: collapse;
border-left: 1px solid #efefef;
border-right: 1px solid #efefef;
border-bottom: 1px solid #efefef;
}
Might look a little nutty Don't need the answer written out just would like to pointed in the right direction, Thanks
Last edited by Dsiembab; Apr 17th, 2007 at 2:54 am. Reason: was confusing and maybe still is
Similar Threads
Reputation Points: 18
Solved Threads: 2
Junior Poster
Dsiembab is offline Offline
156 posts
since Mar 2007
Apr 17th, 2007
0

Re: css div's and tables table cells and scrolling

Give the table cell you want to scroll an id, then give it a fixed height, and set overlfow to scroll. Should look something like this:

td#id {
height: 400px;
overflow: scroll;
}

I would also like to coment, that when using div's for layout I rarely use more than 5 or 6. I'm not sure why you think you have to have as many as you believe you do.
Reputation Points: 17
Solved Threads: 14
Posting Whiz
DanceInstructor is offline Offline
355 posts
since Feb 2005
Apr 17th, 2007
0

Re: css div's and tables table cells and scrolling

Thanks for the reply, appreciate it, I was wondering though if I could set this class to all my td's using the min-height and the max-hieght and the overflow auto? right now my page has 8 <div>s I thought i had to use so many div's for the layout. Thanks again, dave
Reputation Points: 18
Solved Threads: 2
Junior Poster
Dsiembab is offline Offline
156 posts
since Mar 2007
May 8th, 2007
0

Re: css div's and tables table cells and scrolling

I bought o'rielly's css definitive guide so I don't have to ask uninformed questions.
Reputation Points: 18
Solved Threads: 2
Junior Poster
Dsiembab is offline Offline
156 posts
since Mar 2007
May 8th, 2007
0

Re: css div's and tables table cells and scrolling

Click to Expand / Collapse  Quote originally posted by Dsiembab ...
Thanks for the reply, appreciate it, I was wondering though if I could set this class to all my td's using the min-height and the max-hieght and the overflow auto? right now my page has 8 <div>s I thought i had to use so many div's for the layout. Thanks again, dave
You certainly can.

Instead of:
HTML and CSS Syntax (Toggle Plain Text)
  1. td#id
in the above style use:
HTML and CSS Syntax (Toggle Plain Text)
  1. .scrol
Then use this for the opening td or div tags, like this:
HTML and CSS Syntax (Toggle Plain Text)
  1. <td class="scrol">
Last edited by MidiMagic; May 8th, 2007 at 3:37 pm.
Reputation Points: 730
Solved Threads: 181
Nearly a Senior Poster
MidiMagic is offline Offline
3,314 posts
since Jan 2007
May 8th, 2007
0

Re: css div's and tables table cells and scrolling

Click to Expand / Collapse  Quote originally posted by MidiMagic ...
You certainly can.

Instead of:
HTML and CSS Syntax (Toggle Plain Text)
  1. td#id
in the above style use:
HTML and CSS Syntax (Toggle Plain Text)
  1. .scrol
Then use this for the opening td or div tags, like this:
HTML and CSS Syntax (Toggle Plain Text)
  1. <td class="scrol">
Thanks midi So I would put in my style sheet:
HTML and CSS Syntax (Toggle Plain Text)
  1. .scroll {
  2. max-height: 300px;
  3. min-height: 200px;
  4. overflow: auto;
  5. }
Thanks man appreciate it
Reputation Points: 18
Solved Threads: 2
Junior Poster
Dsiembab is offline Offline
156 posts
since Mar 2007
May 10th, 2007
0

Re: css div's and tables table cells and scrolling

That is correct.
Reputation Points: 730
Solved Threads: 181
Nearly a Senior Poster
MidiMagic is offline Offline
3,314 posts
since Jan 2007

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in HTML and CSS Forum Timeline: arrays & images
Next Thread in HTML and CSS Forum Timeline: Saving a value in a file





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC