在表旁边浮动一个 Div

Wel*_*son 0 html css html-table

我正在尝试使用一个 div 来保存我的广告并浮动到页面右侧。我希望主体中的表格和文本位于广告的左侧,然后在广告结束时一直延伸到页面的右侧。

问题是主体中有一个表格,它不会显示在div的左侧。它显示在其下方。我该如何解决?

<p> 
    <div style="margin:5px; float:right;">
        <img src="ad.jpg" height="600" width="160">
    </div>         
    blah blah blah
    <table width="100%">
        <tr><td>dsf</td></tr>
    </table> 
    the table because of the 100% appears below the div 
    for the ad.jpg instead of to the left of it
</p>
Run Code Online (Sandbox Code Playgroud)

gio*_*o79 5

为表格添加 display:inline css!