Happy-Coding-Clans / vue-easytable

A powerful data table based on vuejs. You can use it as data grid、Microsoft Excel or Google sheets. It supports virtual scroll、cell edit etc.
https://happy-coding-clans.github.io/vue-easytable/
MIT License
3.69k stars 738 forks source link

为啥vue-easytable总是铺满整屏宽度,屏幕左边设置间隙起作用,右边就不起作用,最右边一列总是铺满 #433

Closed zhouhm closed 2 years ago

zhouhm commented 2 years ago

每一列设置width也不行

huangshuwei commented 2 years ago

参考这2个部分文档:

zhouhm commented 2 years ago

这样写好用

    <ve-table
      style="margin-right: 50px;margin-left: 50px;"
      :columns="tableConfig.columns"
      :table-data="tableConfig.tableData"
      :paging-index="(pageIndex-1)*pageSize"
      :cell-style-option="cellStyleOption"
      :border-x="true"
      :border-y="true">
    </ve-table>

但这样写右边就是不起作用

<template>
  <div class="tablePage">
    <h1>表格+分页</h1>
    <!-- 表格-->
    <ve-table
      :columns="tableConfig.columns"
      :table-data="tableConfig.tableData"
      :paging-index="(pageIndex-1)*pageSize"
      :cell-style-option="cellStyleOption"
      :border-x="true"
      :border-y="true">
    </ve-table>
  </div>
</template>
<style>
.tablePage {
        margin-right: 50px;
        margin-left: 50px;
        padding: 0;
        height: 600px;
        width: 100%;
}

</style>