set border for table with overflow is auto

Posted by lucky on Stack Overflow See other posts from Stack Overflow or by lucky
Published on 2010-06-07T13:58:11Z Indexed on 2010/06/07 14:02 UTC
Read the original article Hit count: 286

Filed under:

Hi All,

I would like to have a border for the table with class name as "wanttosetborder". Without the div it is setting border for this table. With the div tag, it is setting border till the last row before div tag,(i.e a line after H2 is displayed) after that no border is displayed.

Please find the code below.

<html>
    <head>
    <head>
        <style type="text/css">
            #user{width: 50px;height:150px;overflow:auto;position:absolute}
        </style>
    </head>
</head>
<body>
    <TABLE class="wanttosetborder" CELLPADDING=1 cellspacing="1" border="1">
        <tr><td>ABC</td></tr>
        <tr><td>H2</td></tr>
        <tr>
            <td>
                <div id="user">
                    <table>
                        <?php for($i=1; $i<=10;$i++) { ?>
                        <tr><td>123</td> </tr>
                            <?php }?>
                    </table>
                </div>
            </td>
        </tr>
    </TABLE>
</body>
</html>

© Stack Overflow or respective owner

Related posts about html