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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

table height 100% with css?

Status
Not open for further replies.

csstefan

Programmer
Sep 26, 2002
10
SE
Is there any way to make a table stretch to the bottom of a page using css1/css2? As you know the <table height=&quot;100%&quot; ... is not valid.

My problem is that I have a centered table where all the content, navigation etc is placed. On some pages with a lot of content I'll get a vertical scrollbar. Moving to a page with no scrollbar will cause the table to move sidewards because the width of the page changes.

 
You mix several completely different things:
1. How to make a table height=100% with css?
2. How to aviod vertical scrolling?
3. How to make a table not to change it's position regardless anything?

Now think again what do you really need to achieve.
 
starway,

Maybe I was unclear and mixed things up.

1) Well, setting table hight to 100% doesn't solve my problem. But would't setting table height to 101% solve it? I will always have a scroll. All pages have the same structure, navigating from one page to another won't cause the table to move horisontally.

2) The point was to ensure that there always is vertical scrolling.
3) See 1).

So, can I set table height to 101% with css?

I know that this solution isn't optional, but I don't know any other way. Maybe someone else know?
(I don't want to add empty paragraphs at the bottom)



 
This will cause there to always be a vertical scrollbar in IE:
<table style=&quot;overflow-y:scroll;&quot;>
Take off the part that's bolded to make it cross-browser and add a horizontal scrollbar. I think that setting it to 101% would make it scroll, but I'm not sure if 101% is a valid height:
<table style=&quot;height:101%;&quot;>

Rick
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top