V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
gaolinjie
V2EX  ›  Android

用 android webview 显示 html 效果和浏览器不同

  •  
  •   gaolinjie · 2012-12-20 10:28:43 +08:00 · 6489 次点击
    这是一个创建于 4139 天前的主题,其中的信息可能已经有所发展或是发生改变。
    html 如下:

    <html>
    <head>
    <style type="text/css">body{color: #63656a }</style>
    </head>

    <body link="#C0C0C0" vlink="#808080" alink="#FF0000">
    <table cellpadding="0" cellspacing="0" border="0" width="100%25">
    <tr>
    <td width="24" valign="top" align="left">
    <img src=http://cdn.v2ex.com/avatar/182b/e0c5/33_mini.png?m=1349211100 class="avatar" border="0" align="default"auto />
    </td>
    <td width="10" valign="top"></td>
    <td width="auto" valign="top" align="left">
    <strong>GordianZ</strong>
    <div class="reply_content">这个功能不错 :)</div>
    </td>
    </tr>
    </table>

    <hr style="border: 1px dotted #ccc; width: 100%" />

    <table cellpadding="0" cellspacing="0" border="0" width="100%25">
    <tr>
    <td width="24" valign="top" align="left">
    <img src=http://cdn.v2ex.com/avatar/f782/2db9/14413_mini.png?m=1340727325 class="avatar" border="0" align="default"auto />
    </td>
    <td width="10" valign="top"></td>
    <td width="auto" valign="top" align="left">
    <strong>ywencn</strong>
    <div class="reply_content">1024</div>
    </td>
    </tr>
    </table>

    <hr style="border: 1px dotted #ccc; width: 100%" />

    <table cellpadding="0" cellspacing="0" border="0" width="100%25">
    <tr>
    <td width="24" valign="top" align="left">
    <img src=http://cdn.v2ex.com/avatar/ed79/8eec/12687_mini.png?m=1354005856 class="avatar" border="0" align="default"auto />
    </td>
    <td width="10" valign="top"></td>
    <td width="auto" valign="top" align="left">
    <strong>cutehalo</strong>
    <div class="reply_content">可以直接 @<a href="/member/1024">1024</a> 不 哈哈哈</div>
    </td>
    </tr>
    </table>
    </body>
    </html>

    在浏览器上的效果:


    在 android webview 中效果:


    搞不懂为什么总是前几项用户头像和用户名不在同一行,而到了最后一项又正常了?
    2 条回复    1970-01-01 08:00:00 +08:00
    kevan
        1
    kevan  
       2012-12-20 13:43:10 +08:00
    代码有问题?

    <table cellpadding="0" cellspacing="0" border="0" width="100%25">

    width="100%25">
    Sukizen
        2
    Sukizen  
       2012-12-21 10:51:05 +08:00
    对TABLE不熟悉。


    .fl { float:right; }

    <ul>
    <li>
    <h3 class="author"><span class="avatar fl"><img /></span></h3>
    <div class="reply_content"></div>
    </li>
    </ul>
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   2666 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 22ms · UTC 15:30 · PVG 23:30 · LAX 08:30 · JFK 11:30
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.