什麼會導致下列代碼將表格堆疊在一起?我正在使用不休息?html表格不會彼此相鄰,而是彼此垂直
<div id="wrapper">
<table>
<tr>yo</tr>
</table>
<table style="float:right;"><tr>yo</tr></table>
</div>
什麼會導致下列代碼將表格堆疊在一起?我正在使用不休息?html表格不會彼此相鄰,而是彼此垂直
<div id="wrapper">
<table>
<tr>yo</tr>
</table>
<table style="float:right;"><tr>yo</tr></table>
</div>
<div id="wrapper">
<table>
<tr>
<td>
<table>
<tr><td>yo</td></tr>
</table>
</td>
<td>
<table style="float:right;">
<tr>
<td>yo</td>
</tr>
</table>
</td>
</tr>
</table>
</div>
當你漂浮的元素,它不僅影響所有後前來的元素。
嘗試給予第一個表float:left
而不是/以及。
浮動的元件有兩個作用:
由於內容第一個表不是浮動的,第二個表不能在它旁邊冒泡。
把你想要浮動的表格放在第一位,第二個表格放在它的左邊。
沒有有效的td
奇怪的事情發生我並不感到驚訝。
嘗試:
<table>
<tr>
<td>yo</td>
</tr>
</table>
,並檢查發生了什麼。
試試這個
<table style="float:left;">
<tr>yo</tr>
</table>
<table style="float:right;">
<tr>yo</tr>
</table>
</div>
錶行需要包含'td'元素 –