在div里面我的滚动条显示但不能使用它(不工作)

时间:2021-10-30 08:51:34

在div里面我的滚动条显示但不能使用它(不工作)

#smry {
    background-color: #1AB294;
    width: 400px;
    height: 300px;
    float: left;
    margin: 5px 5px auto auto;
    overflow: auto;
}
<div id="smry">
    <h2>Current Account Details</h2><br>

    <?php 
        $sql = "SELECT * FROM username "; 
        $accdtl = mysql_query($sql); 
        while ($row = mysql_fetch_assoc($accdtl))
        { 
            echo '<table>
	            <tr width="100%"><td width="15%">User-Name</td><td width="15%" >Password</td><td width="10%">Type</td></tr>
	            <tr width="100%"><td width="15%" >'.$row['userName']; echo'</td><td width="15%" >'.$row['pass'];echo'</td><td width="10%" >'.$row['type'];echo'</td></tr>
	            </table>';
            echo '<br>';
        };
    ?>
</div>

All other things are working but can't use the scroll bar although it's displaying? I can't understand the problem.

所有其他的东西都在工作,但不能使用滚动条,虽然它正在显示?我无法理解这个问题。

1 个解决方案

#1


1  

It's going to be very difficult to try and diagnose this without being able to see what the php returns.

如果不能看到php返回的内容,那么尝试和诊断这将是非常困难的。

Throwing the bits into a fiddle and adding some junk data I get this, which works fine.

将这些位扔进一个小提琴并添加一些垃圾数据我得到了这个,这很好。

<div id="smry">
    <h2>Current Account Details</h2>
    <br>

    <table>
        <tr width="100%"><td width="15%">User-Name</td><td width="15%" >Password</td><td width="10%">Type</td></tr>

        <tr width="100%"><td width="15%" >asdasd</td><td width="15%" >asdasd</td><td width="10%" >asdas</td></tr><tr width="100%"><td width="15%" >asdasd</td><td width="15%" >asdasd</td><td width="10%" >asdas</td></tr><tr width="100%"><td width="15%" >asdasd</td><td width="15%" >asdasd</td><td width="10%" >asdas</td></tr><tr width="100%"><td width="15%" >asdasd</td><td width="15%" >asdasd</td><td width="10%" >asdas</td></tr><tr width="100%"><td width="15%" >asdasd</td><td width="15%" >asdasd</td><td width="10%" >asdas</td></tr><tr width="100%"><td width="15%" >asdasd</td><td width="15%" >asdasd</td><td width="10%" >asdas</td></tr><tr width="100%"><td width="15%" >asdasd</td><td width="15%" >asdasd</td><td width="10%" >asdas</td></tr><tr width="100%"><td width="15%" >asdasd</td><td width="15%" >asdasd</td><td width="10%" >asdas</td></tr><tr width="100%"><td width="15%" >asdasd</td><td width="15%" >asdasd</td><td width="10%" >asdas</td></tr><tr width="100%"><td width="15%" >asdasd</td><td width="15%" >asdasd</td><td width="10%" >asdas</td></tr><tr width="100%"><td width="15%" >asdasd</td><td width="15%" >asdasd</td><td width="10%" >asdas</td></tr><tr width="100%"><td width="15%" >asdasd</td><td width="15%" >asdasd</td><td width="10%" >asdas</td></tr><tr width="100%"><td width="15%" >asdasd</td><td width="15%" >asdasd</td><td width="10%" >asdas</td></tr><tr width="100%"><td width="15%" >asdasd</td><td width="15%" >asdasd</td><td width="10%" >asdas</td></tr><tr width="100%"><td width="15%" >asdasd</td><td width="15%" >asdasd</td><td width="10%" >asdas</td></tr><tr width="100%"><td width="15%" >asdasd</td><td width="15%" >asdasd</td><td width="10%" >asdas</td></tr>
    </table>
</div>

#smry {
    background-color: #1AB294;
    width: 400px;
    height:300px;
    float:left;
    margin : 5px 5px auto auto;
    overflow:auto;
}

#1


1  

It's going to be very difficult to try and diagnose this without being able to see what the php returns.

如果不能看到php返回的内容,那么尝试和诊断这将是非常困难的。

Throwing the bits into a fiddle and adding some junk data I get this, which works fine.

将这些位扔进一个小提琴并添加一些垃圾数据我得到了这个,这很好。

<div id="smry">
    <h2>Current Account Details</h2>
    <br>

    <table>
        <tr width="100%"><td width="15%">User-Name</td><td width="15%" >Password</td><td width="10%">Type</td></tr>

        <tr width="100%"><td width="15%" >asdasd</td><td width="15%" >asdasd</td><td width="10%" >asdas</td></tr><tr width="100%"><td width="15%" >asdasd</td><td width="15%" >asdasd</td><td width="10%" >asdas</td></tr><tr width="100%"><td width="15%" >asdasd</td><td width="15%" >asdasd</td><td width="10%" >asdas</td></tr><tr width="100%"><td width="15%" >asdasd</td><td width="15%" >asdasd</td><td width="10%" >asdas</td></tr><tr width="100%"><td width="15%" >asdasd</td><td width="15%" >asdasd</td><td width="10%" >asdas</td></tr><tr width="100%"><td width="15%" >asdasd</td><td width="15%" >asdasd</td><td width="10%" >asdas</td></tr><tr width="100%"><td width="15%" >asdasd</td><td width="15%" >asdasd</td><td width="10%" >asdas</td></tr><tr width="100%"><td width="15%" >asdasd</td><td width="15%" >asdasd</td><td width="10%" >asdas</td></tr><tr width="100%"><td width="15%" >asdasd</td><td width="15%" >asdasd</td><td width="10%" >asdas</td></tr><tr width="100%"><td width="15%" >asdasd</td><td width="15%" >asdasd</td><td width="10%" >asdas</td></tr><tr width="100%"><td width="15%" >asdasd</td><td width="15%" >asdasd</td><td width="10%" >asdas</td></tr><tr width="100%"><td width="15%" >asdasd</td><td width="15%" >asdasd</td><td width="10%" >asdas</td></tr><tr width="100%"><td width="15%" >asdasd</td><td width="15%" >asdasd</td><td width="10%" >asdas</td></tr><tr width="100%"><td width="15%" >asdasd</td><td width="15%" >asdasd</td><td width="10%" >asdas</td></tr><tr width="100%"><td width="15%" >asdasd</td><td width="15%" >asdasd</td><td width="10%" >asdas</td></tr><tr width="100%"><td width="15%" >asdasd</td><td width="15%" >asdasd</td><td width="10%" >asdas</td></tr>
    </table>
</div>

#smry {
    background-color: #1AB294;
    width: 400px;
    height:300px;
    float:left;
    margin : 5px 5px auto auto;
    overflow:auto;
}