我的以下代码有一个包含两列的表。表格的总宽度为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>
最佳答案
将CSS用于
:table{width:100%}
td{width:50%}
09-10 03:00
-
arrays - 为什么不能超出* [] Struct?
-
c++ - 在C++中使用类模板作为回调
-
node.js - 使用nodejs从Twilio发送多个媒体文件
-
java - 在Java应用程序中找到类,但在JSF中找不到类?
-
android - 我正在尝试在我的测试应用程序中实现expandablelistview,但该应用程序每次都会崩溃
-
c++ - 如何在C++中串联字符串?
-
linux - 如何在文件的特定列中搜索Shell中的字符串?
-
c++ - 读取文件直到空白行
-
c++ - 为什么Visual Studio 2010调试器看不到静态const类成员?
-
java - JPA/Hibernate:CriteriaBuilder-如何使用关系对象创建查询?
-
java - 我在尝试将堆栈实现为数组的过程中不断收到“找不到符号”错误
-
c++ - 使用演绎的C++可变展开
-
c++ - 为什么插入运算符是打印地址而不是字符串?
-
java - 在 Spring petclinic中切换数据库
-
python - 根据列中的嵌套JSON添加DataFrame列