index.vue 3.47 KB
<template>
    <div class="main">
        <table border="1">
            <tr>
                <td colspan="2">土地面积</td>
                <td colspan="3"><input type="text" class="formInput"/></td>
            </tr>
            <tr>
                <td colspan="2">宗地代码</td>
                <td colspan="3"><input type="text" class="formInput"/></td>
            </tr>
            <tr>
                <td colspan="2">宗地面积(㎡)</td>
                <td><input type="text" class="formInput"/></td>
                <td>定着物数量</td>
                <td><input type="text" class="formInput"/></td>
            </tr>
            <tr>
                <td colspan="2">备注</td>
                <td colspan="3"><input type="text" class="formInput"/></td>
            </tr>
        </table>
        <el-table
                :data="tableData"
                height="250"
                border
                style="width: 100%">
            <el-table-column
                    prop="date"
                    label="日期"
                    width="180">
            </el-table-column>
            <el-table-column
                    prop="name"
                    label="姓名"
                    width="180">
            </el-table-column>
            <el-table-column
                    prop="address"
                    label="地址">
            </el-table-column>
        </el-table>
    </div>
</template>

<script>
    export default {
        name: "index",
        data() {
            return {
                tableData: [{
                    id: '12987122',
                    name: '王小虎',
                    amount1: '234',
                    amount2: '3.2',
                    amount3: 10
                }, {
                    id: '12987123',
                    name: '王小虎',
                    amount1: '165',
                    amount2: '4.43',
                    amount3: 12
                }, {
                    id: '12987124',
                    name: '王小虎',
                    amount1: '324',
                    amount2: '1.9',
                    amount3: 9
                }, {
                    id: '12987125',
                    name: '王小虎',
                    amount1: '621',
                    amount2: '2.2',
                    amount3: 17
                }, {
                    id: '12987126',
                    name: '王小虎',
                    amount1: '539',
                    amount2: '4.1',
                    amount3: 15
                }]
            }
        },
        methods: {
            addTableRow() {
                let table2 = document.getElementById("table2")
                let table3 = document.getElementById("table3")
                table2.firstChild.appendChild(table3)
            },
            delTableRow() {
                let table = document.getElementsByTagName("table")
            }
        },
        mounted() {

        }
    }
</script>

<style scoped>
    .main {
        box-sizing: border-box;
        padding: 18px;
        height: auto;
        width: 80%;
    }

    table {
        margin-top: 10px;
        background-color: #fff;
        font-size: 14px;
        width: 100%;
    }

    td {
        text-align: center;
        height: 36px;
    }

    table .formInput {
        margin: 0;
        height: 36px;
        outline: none;
        border: none;
        color: #606764;
        overflow: visible;
        text-align: center;
        cursor: text;
    }


</style>