表溢出:滚动属性

时间:2013-01-20 21:59:12

标签: css html-table overflow

我必须在表中的所有表列上创建一个包含scroll属性的表。但它没有固定表的高度,也没有给数据赋予scroll属性。

<table>
    <tr>
        <td valign="top">
            <h3>Latest Reviews</h3>
            <p><b>This gives the latest riview posted on the website</b></br></p>       
            <p><b>This gives the latest riview posted on the website</b></br></p>
        </td>
        <td valign="top">
            <h3>Top Rated</h3>
            <p>9.3/10</br></p>
            <p>8.3/10</br></p>
        </td>
        <td valign="top">
            <h3>Recipes</h3>
            <p><b><a href="recipe.php">Recipe Title</a></b></p>
            <p><b><a href="recipe.php">Recipe Title</a></b></p>
        </td>
    </tr>
</table>

相关的CSS代码在这里:

table{
   width:100%;
}
td{
   width:30%;
   height: 100px;
   display: block;
   overflow-y: auto;
}   

毕竟这个表的高度等于具有最大高度的列。有人请解决这个问题。

0 个答案:

没有答案
相关问题