Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/80.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 水平对齐两个按钮4_Html_Css_Twitter Bootstrap_Alignment - Fatal编程技术网

Html 水平对齐两个按钮4

Html 水平对齐两个按钮4,html,css,twitter-bootstrap,alignment,Html,Css,Twitter Bootstrap,Alignment,我试图将两个引导按钮并排水平对齐,并将它们放在一个表格单元格的中心,但我做不到 我使用bootstrap4 <div> <table class="table table-striped table-bordered"> <tr> <th>ID</th> <th>Nom categorie </th> <th>Op

我试图将两个引导按钮并排水平对齐,并将它们放在一个表格单元格的中心,但我做不到

我使用bootstrap4

<div>
    <table class="table table-striped table-bordered">
      <tr>
        <th>ID</th>
        <th>Nom categorie </th>
        <th>Operations</th>
      </tr>
      <tr *ngFor="let categorie of categories">
        <td>{{ categorie.id }}</td>
        <td>{{ categorie.nom }}</td>
        <td >
          <div class="row">
            <div class="col-sm-12" style="display: flex; flex-direction: row;align-content: space-between">
              <button type="button"  class="btn btn-secondary">Mettre à jour </button>
              <button type="button"  class="btn btn-secondary">Supprimer</button>
            </div>
          </div>
          
        </td>
      </tr>
    </table>
  </div>
试试这个

xbutton先生{ 宽度:150px; 高度:30px; 利润率:0.10px; } 西罗{ 文本对齐:居中; } B.布顿街{ 弹性:1; 文本对齐:居中; } 梅特雷日 供给者 请试试这个

将此样式赋予button div

justify-content: center;align-items: center;
并在第一个按钮上添加小边距的右侧mr-2,以便在按钮之间留出间隙

身份证件 名称分类 操作 {{categorie.id} {{categorie.nom}} 梅特雷日 供给者
将justify content center类添加到按钮周围的包装器Hello@Bodda,我尝试了这个方法,但我有边距,但这两个按钮在表格的单元格中不居中我编辑了注释它应该居中现在Hi@Bodda,我完成了xrow,但它没有居中是的,我得到了它,添加到xbutton样式中这个flex:1。我将编辑代码alsoHi@Bodda,现在它居中,但我的表格单元格中心有两个大按钮。我删除了xbutton类中的width属性,但结果还不够,您有其他想法吗