Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/33.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
Css 两个div边界的相等对齐_Css_Twitter Bootstrap - Fatal编程技术网

Css 两个div边界的相等对齐

Css 两个div边界的相等对齐,css,twitter-bootstrap,Css,Twitter Bootstrap,我使用bootstrap构建布局,尝试使用divs构建表 但是我无法使2个div的边框在垂直方向上正确对齐 HTML: 图片: 添加以下CSS #p_table { display: table; width: 100%; } #p_table > .row { display: table-row; } #p_table > .row > div { display: table-cell; } 要将div设置为表格单元格的样式为什么不使

我使用bootstrap构建布局,尝试使用divs构建表 但是我无法使2个div的边框在垂直方向上正确对齐

HTML:

图片:

添加以下CSS

#p_table {
    display: table;
    width: 100%;
}

#p_table > .row {
    display: table-row;
}

#p_table > .row > div {
    display: table-cell;
}

要将div设置为表格单元格的样式

为什么不使用实际的表格?完全正确。这似乎是你想要放在那里的表格数据。桌子并非对一切都有害;
#p_table {
  border-left:1px solid #ccc;
  border-right:1px solid #ccc;
  border-bottom:1px solid #ccc;
}

#h_tb {
  font-size:24px;   
  color:#000;  
  border-bottom:1px solid #ccc;
  text-align: center;
  margin:0;
}
#p_table {
    display: table;
    width: 100%;
}

#p_table > .row {
    display: table-row;
}

#p_table > .row > div {
    display: table-cell;
}