【问题标题】:How to increase table width如何增加表格宽度
【发布时间】:2020-07-08 18:49:20
【问题描述】:

我正在尝试增加表格宽度并填充额外的空格,但列的宽度并没有改变我在下面给我的宽度:

            <tr v-for="user in paginatedUsers" :key="user.id">
                <td style="width: 10%">{{user.id}}</td>
                <td style="width: 30%">{{user.case_id}}</td>
                <td style="width: 40%">{{user.user_id}}</td>
                <td style="width: 50%">{{user.message_title}}</td>
                <td style="width: 60%">{{user.process_type}}</td>
                <td style="width: 70%">{{user.msg_code}}</td>
                <td style="width: 80%">{{user.log_type}}</td>
                <td style="width: 90%">{{user.created_at}}</td>
            </tr>
            </tbody>

我还附上了我的数据表的屏幕截图:

我哪里出错了?

【问题讨论】:

标签: css vue.js datatable width


【解决方案1】:

列的总宽度应为 100%。请试试这个。

<tr v-for="user in paginatedUsers" :key="user.id">
    <td style="width: 5%">{{user.id}}</td>
    <td style="width: 10%">{{user.case_id}}</td>
    <td style="width: 10%">{{user.user_id}}</td>
    <td style="width: 20%">{{user.message_title}}</td>
    <td style="width: 20%">{{user.process_type}}</td>
    <td style="width: 5%">{{user.msg_code}}</td>
    <td style="width: 10%">{{user.log_type}}</td>
    <td style="width: 20%">{{user.created_at}}</td>
</tr>

【讨论】:

  • 我看到你的标题也更长了。这也会影响大小。你也可以稍微调整一下。
  • 我已附上截图
  • 尽量缩短。像“消息代码”到“代码”。
  • 我已尝试缩短我的标题并附上输出
猜你喜欢
  • 2012-01-14
  • 2011-01-17
  • 2012-10-03
  • 1970-01-01
  • 1970-01-01
  • 2011-08-28
  • 2016-02-21
  • 2013-02-14
  • 2014-04-14
相关资源
最近更新 更多