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/CSS:如何设置此表的大小?_Html_Css_Css Tables - Fatal编程技术网

HTML/CSS:如何设置此表的大小?

HTML/CSS:如何设置此表的大小?,html,css,css-tables,Html,Css,Css Tables,如果您访问下面的链接并将一个项目添加到购物车中(使购物车显示在侧栏中),您会注意到购物车与侧栏小部件的边缘重叠 我需要编写什么样的CSS才能使表成为其父容器的大小?您需要更改th和td元素的填充: table thead tr th, table tfoot tr td { padding: 8px 10px 9px; font-size: 14px; font-weight: bold; color: #222; } 对于购物车中的0-9件物品,5可作为左右两侧的良好填充物

如果您访问下面的链接并将一个项目添加到购物车中(使购物车显示在侧栏中),您会注意到购物车与侧栏小部件的边缘重叠


我需要编写什么样的CSS才能使表成为其父容器的大小?

您需要更改
th
td
元素的填充:

table thead tr th,
table tfoot tr td {
  padding: 8px 10px 9px;
  font-size: 14px;
  font-weight: bold;
  color: #222;
}
对于购物车中的0-9件物品,
5
可作为左右两侧的良好填充物。如果你想走得更高,你需要把它推得更低

table thead tr th,
table tfoot tr td {
  padding: 8px 5px 9px;
  font-size: 14px;
  font-weight: bold;
  color: #222;
}

另一个选择是更改字体大小。这完全取决于您自己,您认为什么可以在不影响可用性的情况下工作。

您需要更改
th
td
元素的填充:

table thead tr th,
table tfoot tr td {
  padding: 8px 10px 9px;
  font-size: 14px;
  font-weight: bold;
  color: #222;
}
对于购物车中的0-9件物品,
5
可作为左右两侧的良好填充物。如果你想走得更高,你需要把它推得更低

table thead tr th,
table tfoot tr td {
  padding: 8px 5px 9px;
  font-size: 14px;
  font-weight: bold;
  color: #222;
}

另一个选择是更改字体大小。这真的取决于你自己,你认为什么工作不会影响可用性。

表格布局:在你的
表格中修复。eshop
。这样写:

table.eshop {
    border-collapse: collapse;
    table-layout: fixed;
    width: 99%;
    word-wrap: break-word;
}

写入表格布局:已修复
表格中的。eshop
。这样写:

table.eshop {
    border-collapse: collapse;
    table-layout: fixed;
    width: 99%;
    word-wrap: break-word;
}