首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >为什么表格单元格的大小不同,尽管内容相同?

为什么表格单元格的大小不同,尽管内容相同?
EN

Stack Overflow用户
提问于 2014-12-02 10:10:15
回答 2查看 54关注 0票数 1

我有一个两行三列的表。右边的两个单元格的宽度比左边的两个小。为什么会这样呢?两者的内容是相同的。寻求帮助。

代码语言:javascript
复制
<div id="tableContain">
    <div id="tabRow1">
        <div id="tabCell">The gibberish (nonsense text) presented here </div>
        <div id="tabCell"> <img src="images/Flora/tree-of-life.jpg" /> </div>
        <div id="tabCell">The gibberish (nonsense text) presented here </div>
    </div>

    <div id="tabRow2">
        <div id="tabCell">The gibberish (nonsense text) presented here </div>
        <div id="tabCell"> <img src="images/Flora/tree-of-life.jpg" /> </div>
        <div id="tabCell">The gibberish (nonsense text) presented here </div>
    </div>
</div>

#tableContain {
    display: table;
    width: 600px;
    margin: auto;
    border-spacing: 10px;
}

#tabRow1, #tabRow2 {
    display: table-row;
}

#tabCell {
    display: table-cell;
    border: 2px solid gray;
    padding: 10px;
    border-collapse: collapse;
}

img {
    width: 200px;
}
EN

Stack Overflow用户

发布于 2014-12-02 10:20:12

试试这个。

代码语言:javascript
复制
#tabRow1, #tabRow2 {
display: table-row;
 width: 600px;}
票数 1
EN
查看全部 2 条回答
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/27240759

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档