Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/77.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/36.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html 将表格单元格内的按钮移动到中心_Html_Css_Vue.js_Button_Html Table - Fatal编程技术网

Html 将表格单元格内的按钮移动到中心

Html 将表格单元格内的按钮移动到中心,html,css,vue.js,button,html-table,Html,Css,Vue.js,Button,Html Table,我有一个按钮在一个表单元格内。表是这样的: <b-table v-if="rows.length" :thead-tr-class="'bug-report-thead'" :tbody-tr-class="'bug-report-tbody'" :items="rows" :fields="columnsToDisplay" :sort-compare="sortTableByKe

我有一个按钮在一个表单元格内。表是这样的:

      <b-table
        v-if="rows.length"
        :thead-tr-class="'bug-report-thead'"
        :tbody-tr-class="'bug-report-tbody'"
        :items="rows"
        :fields="columnsToDisplay"
        :sort-compare="sortTableByKey"
        :striped="true"
        :bordered="true"
        :outlined="true"
        :hover="true"
        :no-sort-reset="true"
        :show-empty="true"
        :filter="filter"
        @filtered="onFiltered"
        :empty-text="emptyText"
        :sort-desc="true"
        :caption-top="true"
        responsive>
/b-table>

/b表>
按钮是这样的

<template slot="iinstances" slot-scope="row">
  <div v-if=" total_rows>0 && row.item.imProdInstDet!=''">  
    <b-button style="text-align: center" :variant="'primary'" @click.stop="row.toggleDetails" class="mr-1"> 
      More Details
    </b-button>
  </div>
</template>

更多细节

如何将上述按钮移动到单元格的中心?我试过,
margin:auto;显示:块如下所示:但这似乎不起作用

每个列的自定义样式和类的字段对象中都有一个属性

试试这样:


测试
导出默认值{
名称:“应用程序”,
数据:()=>({
字段:['id','name',{key:'button',class:'text center'}],
项目:[
{id:1,名称:'Row 1'},
{id:2,名称:'Row 2'},
{id:3,名称:'Row 3'},
{id:4,名称:'row4'},
{id:5,名称:'row5'},
],
}),
};

Give
text align:center
td
,其中有
按钮
it@Kenny,这是一个引导vue表。我没有为此单独创建行。根据存在的数据,将创建行。我只以
标签
的形式创建了列名。因此,似乎找不到可以传递上述内容的选项。您正在查找
数据对齐
&
数据对齐
。您可以使用