如何翻譯下面的代碼以使用三個div並且看起來相同?表格對div問題
<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>
如何翻譯下面的代碼以使用三個div並且看起來相同?表格對div問題
<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>
這裏的幾乎是相同的答案達斯汀帶一點顏色拋出使用右列中的和列表。
<!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>
非常感謝! – Jenny 2010-10-21 19:12:10
而不是得到它*翻譯的*,你需要學習CSS,你將需要反正知道它:) – Sarfraz 2010-10-21 18:46:04
如果工作作爲一個表,把它作爲一個表。 – DwB 2010-10-21 18:46:35
@dwb - 什麼!除非是表格數據,否則不應該是表格。 – 2010-10-21 18:49:06