如何创建溢出时滚动的表格单元格

问题描述

| 我必须创建一个高度和宽度固定但内容很多的表格单元。使用using0ѭ的东西。问题是我不能在表格单元格上使用ѭ1(这会破坏表格布局),所以我尝试了以下操作:
height: 100px;
overflow: auto;
position: relative;
width: 1280px;
但这不起作用。这是我的标记
        <tr>
            <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}     
                        {/foreach}
                    </div>
                </div>
            </td>
        </tr>
    

解决方法

您可以在表单元格中嵌套一个具有溢流:滚动属性的块级div。即
<td><div style=\"overflow:scroll;\">Content</div></td>