2

在 IE8 中它没有滚动...如何使我的结果表可滚动?

<tr>
    <td><input type="radio" name="sso" value="<?php echo $exec->fields['hrOracleNumber']; ?>" onclick="selectSSO(this.value);"></td>
    <td><font color="336699" face="Helvetica" size="1px" ><?php echo $exec->fields['hrOracleNumber']; ?></font></td>
    <td><font color="336699" face="Helvetica" size="1px" ><?php echo $exec->fields['firstName']; ?></font></td>
    <td><font color="336699" face="Helvetica" size="1px" ><?php echo $exec->fields['lastName']; ?></font></td>
    <td><font color="336699" face="Helvetica" size="1px" ><?php echo $exec->fields['description']; ?></font></td>
</tr>

<?php 

    $exec->MoveNext();
} ?>
</table>
<?php } ?>
4

1 回答 1

2

First off, you would need more rows to scroll vertically.

But to make the table scroll you would wrap it in a div tag and apply CSS styling to that div by adding a fixed height and set the overflow to auto.

The html would look like this:

<div class="scroll-table">
<table>
<tr>
    <td><input type="radio" name="sso" value=""></td>
    <td><font color="336699" face="Helvetica" size="1px" >Test</font></td>
    <td><font color="336699" face="Helvetica" size="1px" >Test</font></td>
    <td><font color="336699" face="Helvetica" size="1px" >Test</font></td>
    <td><font color="336699" face="Helvetica" size="1px" >Test</font></td>
</tr>
</table>
</div>

The CSS style sheet would look like this:

   .scroll-table{
       height: 50px;
       overflow: auto;
    }

IE 8 doesn't support overflow-x or overflow-y, so you might want to specify a width as well because overflow auto will allow scrolling in both directions.

于 2012-11-21T23:19:25.167 回答