layer position and scrollbar
Microsoft Office TrainingThe UK's Number 1 for Microsoft Office Training Sitemap add this page to your favourites/bookmarksBookmark page
 
view a printable version of this pagePrintable version
Plus One Google
Customer: Sign in
Delegate: Sign in
Trainer: Log in

Forum home » Delegate support and help forum » Dreamweaver Training and help » Layer Position and Scrollbar on a table

Layer Position and Scrollbar on a table

resolvedResolved · Medium Priority · Version CS3

replyReplyWed 2 Jul 2008, 17:00Delegate Duncan said...

Layer Position and Scrollbar on a table

Hello
two probs. 1. I have made my index page (www.therollingimage.com) using a table, the news part is a layer with an iFrame. I really wanted all of my content in the middle of the screen, but if i centralise the table, and manually move the layer then the layer will not be in the same place on a smaller screen. So how do i make its position relative to the table location?

And No.2, (and this is really simple but i've totally forgotten) if i'm putting text straight in to a table (450px high) how do i add a verticle scroll bar to the table so the viewer scrolls the table text as opposed to the entire page?

Thanks

Duncan

For upcoming training course dates see: Pricing & availability

replyReplySat 5 Jul 2008, 20:25Trainer Rich said...

RE: Layer Position and Scrollbar on a table

Hi Duncan,

1) You're using Absolute Positioning for all your layers. So you'll need to either let the layers sort themselves out, or use table layout.

DIV layout: set your body definition to be text align Center (will centre everything in body). Then have a div, but set text align to be Left. This is a standard method that may work for you. See example below:

<html>
<head>
<style type="text/css">
<!--
body {
text-align: center;
}
#maincontent {
text-align: left;
width: 600px;
background-color: red;
}

-->
</style>
</head>

<body>
<div id="maincontent">This is main content
<iframe height="200" width="200">Whatever</iframe>
</div>
</body>
</html>


Table layout: have a 1 celled table at 100% width and height.
eg.

<table width="100%" height="100%"><tr><td>
ALL YOUR STUFF INCLUDING OTHER TABLES IF REQUIRED
</td></tr></table>


The first method is recommended but i would recommend testing in all browsers.

2) I must admit I've never needed to scroll just a table cell. Anyway, I found a way to do it with CSS. Here is the sample code:

<html>
<head>
<title>table with scroll</title>
<style type="text/css">
<!--
DIV{
text-align : left;
padding : 5px;
width : 100%;
height : 4em;
overflow: auto;
}
-->
</style>
</head>
<body>
<table cellpadding="0" cellspacing="0" border="1">
<thead>
<tr>
<th>stuff in the thead</th>
</tr>
</thead>
<tfoot>
<tr>
<th>stuff in the tfoot</th>
</tr>
</tfoot>
<tbody>
<tr>
<td>
<div>scroll stuff in the tbody<br>
scroll stuff in the tbody<br>
scroll stuff in the tbody<br>
scroll stuff in the tbody<br>
scroll stuff in the tbody<br>
scroll stuff in the tbody<br>
scroll stuff in the tbody<br>
scroll stuff in the tbody<br>
scroll stuff in the tbody<br>
scroll stuff in the tbody<br>
scroll stuff in the tbody<br>
</div>
</td>
</tr>
</tbody>
</table>
</body>
</html>


Let me know how you get on.

Regards, Rich

Source: http://allmyfaqs.net/faq.pl?Scrolling_table_cell

replyReplyWed 9 Jul 2008, 17:24Delegate Duncan said...

RE: Layer Position and Scrollbar on a table

Hi Rich
The second one should work ok. One thing though, when i stick in a lot of text two scroll bars appear side by side. If i remove half of the text one disappears. Try this, then remove half and see if the same happens.


<html>
<head>
<title>table with scroll</title>
<style type="text/css">
<!--
DIV{
text-align : center;
padding : 5px;
width : 100%;
height : 400px;
overflow: auto;
}
-->
</style>
</head>
<body>
<table width="600" height="600" border="1">
<tr>
<td height="73">&nbsp;</td>
</tr>
<tr>
<td><div>
<div>blah blah blahblah blah blahblah blah blahblah blah blahblah blah blahblah blah blahblah blah blahblah blah blahblah blah blahblah blah blahblah blah blahblah blah blahblah blah blahblah blah blahblah blah blahblah blah blahblah blah blahblah blah blahblah blah blahblah blah blahblah blah blahblah blah blahblah blah blahblah blah blahblah blah blahblah blah blahblah blah blahblah blah blahblah blah blahblah blah blahblah blah blahblah blah blahblah blah blahblah blah blahblah blah blahblah blah blahblah blah blahblah blah blahblah blah blahblah blah blahblah blah blahblah blah blahblah blah blahblalahblah blah blahblah blah blahblah blah blahblah blah blahblah blah blahblah blah blahblah blah blahblah blah blahblah blah blahblah blah blahblah blah blahblah blah blahblah blah blblahblblah blahblah blah blahblah blah blahblah blah blahblah blah blahblah blah blahblah blah blahblah blah blahblah blah blahblah blah blahblah blah blahblah blah blahblah blah blahblah blah blahblah blah blahblah blah blahblah blah blahblah blah blahblah blah blahblah blah blahblah blah blahblah blah blahblah blah blahblah blah blahblah blah blahblah blah blahblah blah blahblah blah blahblah blah blahblah blah blahblah blah blahblah blah blahblah blah blahblah blah blahblah blah blahblah blah blahblah blah blahblah blah blahblah blah blahblah blah blahblalahblah blah blahblah blah blahblah blah blahblah blah blahblah blah blahblah blah blahblah blah blahblah blah blahblah blah blahblah blah blahblah blah blahblah blah blahblah blah blblahblah ahlahblah blah blahblah blah blahblah blah blahblah blah blahblah blah blahblah blah blahblah blah blahblah blah blahblah blah blahblah blah blahblah blah blahblah blah blahblah blah blahblalahblah blah blahblah blah blahblah blah blahblah blah blahblah blah blahblah blah blahblah blah blahblah blah blahblah blah blahblah blah blahblah blah blahblah blah blahblah blah blblahblblah blahblah blah blahblah blah blahblah blah blahblah blah blahblah blah blahblah blah blahblah blah blahblah blah blahblah blah blahblah blah blahblah blah blahblah blah blahblah blah blahblah blah blahblah blah blahblah blah blahblah blah blahblah blah blahblah blah blahblah blah blahblah blah blahblah blah blahblah blah blahblah blah blahblah blah blahblah blah blahblah blah blahblah blah blahblah blah blahblah blah blahblah blah blahblah blah blahblah blah blahblah blah blahblah blah blahblah blah blahblah blah blahblah blah blahblah blah blahblalahblah blah blahblah blah blahblah blah blahblah blah blahblah blah blahblah blah blahblah blah blahblah blah blahblah blah blahblah blah blahblah blah blahblah blah blahblah blah blblahbla </div>
</div></td>
</tr>
<tr>
<td height="25">&nbsp;</td>
</tr>
</table>
<p>&nbsp;</p>
</body>
</html>


Does it have anything to do with this?

DIV{
text-align : center;
padding : 5px;
width : 100%;
height : 400px;
overflow: auto;
}

Thanks
Duncan

replyReplyTue 15 Jul 2008, 09:08Trainer Rich said...

RE: Layer Position and Scrollbar on a table

Duncan,

It's cause you've got two div tags, one nested inside the other.

<div><div></div></div>

Remove the middle two and it works.

And yes, it's to do with the CSS (redefining the DIV tag). If you wanted the two div tags to stay (for other style reasons), then you could make your own style up like this:

#scrollme {
text-align : center;
padding : 5px;
width : 100%;
height : 400px;
overflow: auto;
}

First div to scroll:

<div id="scrollme"><div>blah blah</div></div>

Second div to scroll:

<div><div id="scrollme">blah blah</div></div>

Hope that makes sense? If not, experiment a little, then get back to me.

Regards, Rich

 

 

Please browse our web site to find out more about
dreamweaver training in london and other Microsoft training courses.

Dreamweaver tip:

JumpMenu in new window

When inserting a jumpmenu to a page, the only option available for 'open in' is usually 'main window'. There would be other options available if the page was a frameset.

To change the jumpmenu to open in a new window, change the target parameter of the selectbox in your code to 'window.open()'.

eg.
<select name="menu1" onChange="MM_jumpMenu('window.open()',this,0)">


source:
http://kb.adobe.com/selfservice/viewContent.do?externalId=tn_16166&sliceId=1

View all Dreamweaver hints and tips

forum postHow do I remove immediate box around Pie Chart.

» Forum post: PowerPoint


Rate this page:
2.2/5 (213 votes cast)
Accredited Training Provider: Institute of IT Training Institute of Leadership and Management - Certified Courses
Microsoft Certified Partner
Security Seal verified by visa, mastercard securecard

Mini sitemap. These are the main areas of our web site. Full sitemap.

Management training

Professional Skills courses
Project Management Course London
Project Management Courses London
Project Management Training London
Project Management Training
Project Seminar
Project Seminars
Time Management Course London
Time Management London
Time Management Courses London
Time Management Training London
Introduction to Finance course
Assertiveness Skills course
Effective Communications Skills training
Presentation Skills London

Training Formats

Public scheduled courses
On-site training
Closed company courses

Consultancy
Application Development

Blogs

Excel Training
MS Project Training
Microsoft Training Blog

Version differences

Office 2010 vs 2007
MS Project version differences

Training Information

London Computer Training
Computer Training London
Docklands Training Courses
Docklands Training London

Training venues London
Client list
FAQ
Pricing and availability
Course details / Syllabus

Training Articles
Training Information

Microsoft training

Microsoft Office training
& IT Applications

Microsoft Project training
Microsoft Outlook training
Microsoft Powerpoint training
Microsoft Word training
MS Project courses
MS Project training
Outlook courses
PowerPoint courses
PowerPoint training
VBA courses
Word courses
Microsoft.training
(more...)

Excel Training

Excel courses
Excel Training Courses Medway
Autonumber in Excel
Microsoft Excel training
Basic Excel Courses
Basic Excel Course
Basic Excel Training

Interested in MS Access training?

Access courses
Microsoft Access training
Microsoft access courses
Microsoft training access course
Microsoft+access+training
Access courses in london

Training provider

Training providers
IT training companies
IT training providers
Management Training providers
Management Training provider

Event history, feedback results
Events in 2012 · 2011 · 2010 · More

See also

Crystal Reports training