在css中使用位置abolute时表重叠

时间:2017-09-18 19:32:03

标签: css

我正在尝试将一个表放在一个表中,但它们是重叠的。这是由我的CSS造成的。有人可以告诉我如何解决这个问题吗?当我取出绝对值或将其更改为相对值时,页面会丢失大部分样式。

table {
border-collapse: collapse;
margin: 10px;
position: absolute;
display: table;
width: 729px;
height: 101px;
z-index: 0;
border: 1px #C0C0C0 solid;}
table.cell{
display: table-cell;}

这是HTML:

<table  id="estimate_table" style="position: relative ! important;">
    <tr>
        <td>
        <?php //print information here from previous query ?>   <br>        
        <br></td>
        <td></td><td></td>
        <td><h1>Estimate</h1></td>
    </tr>
    <tr>
        <td>
            <table style="position: absolute ! important;">
                <tr>
                    <td>
                        For:<br>
                        <select name="estimate_for">                            
                        <?php
                        //sql query here and while loop to fill dropdown                            
                        ?>
                        </select>
                    </td>
                    <td>
                        Job:<br><textarea name="job_name"></textarea>
                    </td>
                </tr>
            </table>
        </td>
        <td></td>
        <td></td>
        <td>
            Invoice#: <br>
            Date: <input type="text" name="estimate_date" value="<?php echo date('M d, Y'); ?>">                
        </td>
    </tr>       
    <tr>
        <!--four columns with labels-->
    </tr>
    <tr>
        <!--four columns here for user to fill form-->
    </tr>
    <tr>
        <td></td><td></td> <!--skipping two columns and filling in last two in table-->         
    </tr>
</table>

谢谢!

0 个答案:

没有答案