Does overflow work for tables and table cells because I'm having a hell of a time trying to implement overflow?
Printable View
Does overflow work for tables and table cells because I'm having a hell of a time trying to implement overflow?
In theory yes in reality no
http://www.vbforums.com/showthread.p...hreadid=226449
I seem to remember that I got it to work for cells in Mozilla at least, but I could be wrong.
I went to that thread last night and I copied the code and created a scroll bar in a table. I just don't understand what it's doing so I can use it later. Here is the code:
Can someone explain to me what this is doing and where to get information on it? Thanks, JeremyCode:<div>
<span style="overflow-y:auto;height:450;">
<table border="0" align="center" >
:
:
</table>
</span>
</div>
a kind of dinfintion:
DIV
Allows you to insert a division, which is used to partition a document into segments. Divisions are used to enclose other HTML elements to which you want to apply style information or which you want to position absolutely on the page.
You'll have noticed from the thread to drop the SPAN tags and place the style in the DIV
so your setting the height of the DIV to 450
in the event that the content between the div tags renders greater than that height ie it overflows on the y then automatically add a scrollbar
When I took out the span tags, it didn't work. It's working perfect for me the way it is. Do you know why this is happening? I don't want to run into problems later. Thanks, Jeremy
Is this what you have now?
note the style that was in the SPAN is now in the DIVCode:<div style="overflow-y:auto;height:450px;">
<table border="0" align="center" >
:
:
</table>
</div>
I've also just added px to the 450 RickBull pointed out earlier that you should really specify the type
What I mean is there any way to add overflow for just cells,
td.overflow { overflow: auto; height: 60% }
<td class="overflow">data goes here
will that work? I got the overflow to work for the whole table but I just need it for one cell.
I've just checked the CSS specs and (sorry if this was in the other thread, I couldn't be bothered to check :D) overflow only applies to block-level and replaced elements , so it won't (or shouldn't) work on cells. You should be able to do it on table rows I think. I'm not sure if they're classed as block-level elements in CSS though. They are in HTML but I'm not totally sure about CSS, which would explain why overflow doesn't work with tables.