Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/41.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布局问题-带中心图像的3x3表格_Html_Css_Html Table - Fatal编程技术网

HTML布局问题-带中心图像的3x3表格

HTML布局问题-带中心图像的3x3表格,html,css,html-table,Html,Css,Html Table,我正在尝试为HTML页面创建一个3x3布局。我尝试了多种方法使用devs和soley创建一个表,但似乎无法获得围绕中心图像和表行其余部分的均匀距离。以下是我试图实现的布局表示: <body> <h1>Web Portal</h1> <div> <table class="styled"> <tr> <td><button type="button">Click Me

我正在尝试为HTML页面创建一个3x3布局。我尝试了多种方法使用devs和soley创建一个表,但似乎无法获得围绕中心图像和表行其余部分的均匀距离。以下是我试图实现的布局表示:

<body>

<h1>Web Portal</h1>

<div>
    <table class="styled">
    <tr>
        <td><button type="button">Click Me!</button></td>
        <td><button type="button">Click Me!</button></td>
        <td><button type="button">Click Me!</button></td>
    </tr>
    </table>
</div>

<div>
    <table>
        <tr>
            <td><button type="button">Click Me!</button></td>
        </tr>
    </table>

    <img src="rais_globe.png" alt="rais_logo" height="420" width="420">

    <table>
        <tr>
            <td><button type="button">Click Me!</button></td>
        </tr>
    </table>

</div>


门户网站
点击我!
点击我!
点击我!
点击我!
点击我!

HTML

<div class="table">
    <div class="row">
        <div class="cell1">row 1</div>
        <div class="cell2"></div>
        <div class="cell3"></div>
    </div>
    <div class="row">
        <div class="cell1">row 2</div>
        <div class="cell2">
            <img src="http://upload.wikimedia.org/wikipedia/commons/1/1b/Square_200x200.png" />
        </div>
        <div class="cell3"></div>
    </div>
    <div class="row">
        <div class="cell1">row 3</div>
        <div class="cell2"></div>
        <div class="cell3"></div>
    </div>
</div>

尝试使用bootstrap的网格框架。向我们展示一些代码,你尝试了什么?将代码与fiddle一起展示会很好这里有什么问题?用源代码更新帖子
html, body {
    width:100%;
    height:100%;
    margin:0;
    padding:0;
}
.table {
    display:table;
    width:100%;
    height:100%;
    border:1px solid #000;
}
.row {
    display:table-row;
    height:100%;
}
.cell1, .cell2, .cell3 {
    display:table-cell;
    width:33%;
    height:100%;
    border:1px solid #CCC;
}
.cell2 > img {
    width:100%;
    height:auto;
}