Take the 2-minute tour ×

Good day to all.

I must create a table cell with a fixed height and with but with a lot of content... something using overflow: auto. The problem is that I can't use display: block on a table cell (it kind of breaks the table layout) so I tried just this:

height: 100px;
overflow: auto;
position: relative;
width: 1280px;

But... not working.

Can any1 help? Thank you.

            <td colspan="3" style="width: 1280px; overflow:auto;">
                {assign var="latime" value=$agenda|@count}
                {assign var="latime" value=$latime*150}
                <div style="width: 1280px; position: relative; overflow: auto; ">
                    <div style="width: {$latime}px; height: 100px; position:relative;">
                        {assign var="i" value=0}
                        {foreach from=$agenda item=ag}
                            {assign var="img" value=$agenda[$i][3]}
                                &nbsp; &nbsp;<img src="{$img}" id="imag{$i}" onclick='schimbaslidetoti({$i})' />&nbsp; &nbsp;
                            {assign var="i" value=$i+1}     
share|improve this question
I'd need to see more code (or a link) to understand your question better. –  werm Apr 14 '11 at 11:16
why not use overflow: scroll explicitly? auto is browser dependent AFAIK. –  Felix Dombek Apr 14 '11 at 11:33
add comment

2 Answers

You can nest a block-level div with the overflow:scroll property set inside the table cell. ie

<td><div style="overflow:scroll;">Content</div></td>
share|improve this answer
add comment
up vote -8 down vote accepted

Resolved... I used a div with that properties and inserted it in the table cell.

share|improve this answer
can you show me your html by editing your question ?? –  asharajay Apr 14 '11 at 11:20
So, shouldn't you mark DavW's answer as the correct one instead of your own? –  pkExec Jun 19 '13 at 11:32
If you check the date mine was first. I up-ed his because was correct, but mine was faster and the same. Why should I accept an answer that might be a copy of mine? –  zozo Jun 19 '13 at 11:42
2 minutes hardly matters when he came to the table with examples. –  fiXedd Jul 9 '13 at 6:41
Please show your code –  alias51 Dec 28 '13 at 10:30
add comment

Your Answer


