Html 表格至divs问题
如何翻译下面的代码以使用三个div并看起来相同Html 表格至divs问题,html,Html,如何翻译下面的代码以使用三个div并看起来相同 <table width="1050px"> <tr> <td rowspan="2" width="80%"></td> <td width="20%"><p>some text</p></td> </tr> <tr> <td>&l
<table width="1050px">
<tr>
<td rowspan="2" width="80%"></td>
<td width="20%"><p>some text</p></td>
</tr>
<tr>
<td><p>some text</p></td>
</tr>
<table>
没有rowspan,但是您可以通过以下方式获得相同的结果:
<div style="width: 1050px;">
<div style="width: 80%; float: left;">
<p>some text</p>
</div>
<div style="width: 20%; float: left;">
<p>some text</p>
</div>
<div style="width: 100%; clear: left;">
<p>some text</p>
</div>
</div>
这里的答案与Dustin的答案基本相同,只是加入了一些颜色,并在右边的专栏中使用了段落和列表
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Default</title>
<style type="text/css" media="all">
ul { list-style-type: none;
margin-left: 0;
padding-left: 0;}
</style>
</head>
<body>
<table width="1050px">
<tr>
<td rowspan="2" width="80%" >a</td>
<td width="20%" style="background-color: yellow;"><p>some text</p></td>
</tr>
<tr>
<td style="background-color: yellow;"><p>some text</p></td>
</tr>
<table>
<div style="width: 1050px;">
<div style="width: 80%;float: left;">a</div>
<div style="width: 20%; float: left; background-color: yellow;">
<p>some text using paragraphs</p><p>some text</p>
<ul>
<li>some text using lists</li>
<li>some text</li>
</ul>
</div>
</div>
</body>
</html>
您需要学习CSS,而不是翻译它,因为您无论如何都需要了解它:如果它作为一个表工作,请将它作为一个表。@dwb-什么!!!除非是表格数据,否则不应是表格。