Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/259.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
Javascript 如何使用Bootstrap 4对齐表的th和td内容?_Javascript_Php_Html_Css - Fatal编程技术网

Javascript 如何使用Bootstrap 4对齐表的th和td内容?

Javascript 如何使用Bootstrap 4对齐表的th和td内容?,javascript,php,html,css,Javascript,Php,Html,Css,我对th和td内容的对齐有问题。我不知道还能做什么,我已经使用了Bootstrap4中所有可能的类,例如:文本中心、中心块、对齐项目中心、对齐资源中心和其他,但表看起来是一样的。请给我一个想法来解决这个问题,或者更好地帮助我找到问题。提前谢谢 身份证件 员工姓名 用户名 部门 位置 运动 “.$item['id_employee']” “.$item['name_employee']” “.$item['user_employee']” “.$item['name_department']”

我对th和td内容的对齐有问题。我不知道还能做什么,我已经使用了Bootstrap4中所有可能的类,例如:文本中心、中心块、对齐项目中心、对齐资源中心和其他,但表看起来是一样的。请给我一个想法来解决这个问题,或者更好地帮助我找到问题。提前谢谢


身份证件
员工姓名
用户名
部门
位置
运动
“.$item['id_employee']”
“.$item['name_employee']”
“.$item['user_employee']”
“.$item['name_department']”
“.$item['name_position']”
“.$item['name_campaign']”

从图片上看,您似乎有多个表,例如:


身份证件
名称
描述
1.
约翰·史密斯
不适用
身份证件
名称
描述
2.
弗兰克·彼得斯
弗兰克·彼得斯的描述比约翰长得多

请在此处添加您的HTML和CSS代码。在他们开始对您的问题进行投票之前。只是想帮助,td{text align:center;}这是CSS的代码。并且位于函数公共函数viewsEmployeesController()内{$id=$\u SESSION[“id”];$respuesta=Datos::viewsEmployeesModel($id);foreach($respuesta as$row=>$item){#代码…echo'前面的代码在这里……(注释中没有:)请编辑您的问题。你好,Dave,事实上,它只是一个CRUD过程的内部,从您发布的代码中从数据库中提取信息。它看起来不像是只有一个表-循环从哪里开始?我可以在您发布的内容中看到
,因此除非循环从这些标记内部开始由于某种原因,您从帖子中删除了它,然后您就有了多个表。公共函数viewsemployeescocontroller(){$id=$\u SESSION[“id”];$respuesta=Datos::viewsEmployeesModel($id);foreach($respuesta as$row=>$item){#代码…echo'前面的代码就在这里。!!这是代码dave!!
<div class="container-fluid" >
<div class="card border-1">
<div class="table-responsive  my-auto">
 <table id="tabla" class="table table-fixed table-striped table-condensed 
  text-nowrap mb-1">  
        <tr class="card-header bg-info text-center " style="color:white;">
            <th>Id</th>
            <th>Name Employees</th>
            <th>User Name</th>
            <th>Department</th>
            <th>Position</th>
            <th>Campaign</th>
            <th></th>
            <th></th>
        </tr>
        <tr class="text-center"  >
            <td>'.$item['id_employee'].'</td>
            <td>'.$item['name_employee'].'</td>
            <td>'.$item['user_employee'].'</td>
            <td>'.$item['name_department'].'</td>
            <td>'.$item['name_position'].'</td>
            <td>'.$item['name_campaign'].'</td>

            <!--BUTTON DEL MODAL-->
            <td><a href="options.php?action=editEmployee&edit='.$item["id_employee"].'"> 
            <button type="button" style="border-radius:8px;" class="btn btn-outline-primary btn-sm"> 
            <i class="fas fa-edit"></i></button></a></td>

             <td>
        <a href="options.php?action=employee&Del_Employee='.$item["id_employee"].'"> 
             <button style="border-radius:8px;" class="btn btn-outline-danger btn-sm" type="button">
             <i class="fas fa-trash"></i></button></a></td> 
      </tr>
      </table>
      </div>
      </div>
      </div>