Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/templates/2.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 调整表格列的宽度_Html_Css - Fatal编程技术网

Html 调整表格列的宽度

Html 调整表格列的宽度,html,css,Html,Css,我下面的代码有一个有两列的表。桌子的总宽度是800px。我希望两列的宽度相同。因此,我为每个设置了400px。但它不起作用。我想我需要修改我的密码才能得到它。如何做到这一点 <html> <head> <title>OCAAS</title> </head> <style> html { height: 100%; } body {

我下面的代码有一个有两列的表。桌子的总宽度是800px。我希望两列的宽度相同。因此,我为每个设置了400px。但它不起作用。我想我需要修改我的密码才能得到它。如何做到这一点

<html>
    <head>
    <title>OCAAS</title>
    </head>

    <style>
        html { height: 100%; }

        body {
            background: #f5f0ed;
            font: 10px/1 Tahoma, Geneva, Arial, sans-serif;
            font-weight: bold;
            text-aligh: center;
            BACKGROUND-POSITION: center bottom;
        }

        #image{
            width: 300px;
            height: 300px;
            clear: both;
            margin-right: 500px;
            margin-top: -250px;
            background: #green;
        }
        // amend the image
        #image div{
            width: 500px;
            height: 100px;
            float: left;
            line-height: 100px;
            text-align: center;  

        }

        #image div img{
            display: inline-block;
            vertical-align: top;
            max-width: 80%;
            max-height: 80%;
        }


    </style>

    <BODY>
        <table width="800px" height="100%" cellpadding="1" cellspacing="1" border="1" align="center">
                <tr>
                    <td align="right" valign="middle" width="400px">
                        <div id="image">
                            <div><img src="cat.jpg" border="0"/></div>
                        </div>  
                    </td>
                    <td align="right" valign="middle" width="400px">
                        <div id="wording">
                            <div><p>I AM NEW TO THIS</p></div>
                        </div>
                    </td>
                </tr>
        </table>

        <div id="title">

        </div>
    </body>
</html>
margin-right: 500px;

奥卡斯
html{高度:100%;}
身体{
背景:#f5f0ed;
字体:10px/1塔荷马,日内瓦,Arial,无衬线;
字体大小:粗体;
文本长度:居中;
背景位置:中底;
}
#形象{
宽度:300px;
高度:300px;
明确:两者皆有;
右边距:500px;
利润上限:-250px;
背景:绿色;
}
//修改图像
#影像组{
宽度:500px;
高度:100px;
浮动:左;
线高:100px;
文本对齐:居中;
}
#图像分割图像{
显示:内联块;
垂直对齐:顶部;
最大宽度:80%;
最高高度:80%;
}
我是新来的

margin-right: 500px;

图像div width是一个问题(指定的列宽更宽):

margin-right: 500px;
而且

margin-right: 500px;

固定此值(如有必要,使用%相对于td宽度,因为所有这些元素都位于表中),以使表
td
正确对齐。RGD,

使用css进行:
表格{width:100%}
td{width:50%}
margin-right: 500px;