Home > Web Front-end > HTML Tutorial > 关于在div中插入表格的问题!!_html/css_WEB-ITnose

关于在div中插入表格的问题!!_html/css_WEB-ITnose

WBOY
Release: 2016-06-21 09:42:59
Original
1299 people have browsed it

    <div id="main">      <table width="200" border="1">        <tr>          <td bgcolor="#FF3333"> </td>          <td> </td>        </tr>        <tr>          <td bgcolor="#CC6666"> </td>          <td> </td>        </tr>      </table>    </div>
Copy after login

为什么浏览器显示出来表格的背景颜色没改变还是默认的颜色


回复讨论(解决方案)

你是指设置了背景颜色的两个单元格吧,我在Chrome和IE8下测试可以显示背景颜色啊。
代码如下:

<!DOCTYPE html><html>   <head>       <title></title>   </head>      <body>      <div id="main">         <table width="200" border="1">            <tr>               <td bgcolor="#FF3333"> </td>               <td> </td>            </tr>            <tr>               <td bgcolor="#CC6666"> </td>               <td> </td>            </tr>         </table>      </div>         </body></html>
Copy after login

你的不能显示,可能与你所使用的浏览器或者其他部分代码的影响有关。

直接用你的代码 在IE8,Firefox和Chrome下都没问题啊

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template