都知道用div控制显示或不显示;
<div id="divtest">
显示测试
</div>
div的style="display:block" 是显示,即:document.getElementById("divtest").style.display = "block";
style="display:none" 是不显示.即:document.getElementById("divtest").style.display = "none";
用但是如果要让一行中的4列不显示,而其它2列显示.
如果用 div 把其它的4列给包含起来. 就不起作用了
这是就这样了:
命题:
<tr>
<td>肯定显示数据1<td>
<td>肯定显示数据2<td>
<td>待显示数据1<td>
<td>待显示数据2<td>
<td>待显示数据3<td>
<td>待显示数据4<td>
<tr>
要求:
第一列和第二列是肯定的,
后四列是动态显示的.
此时如果用div将后面四列包含起来,用其style 的display 是不好用的.
解答:
<tr>
<td>肯定显示数据1<td>
<td>肯定显示数据2<td>
<td colspan="4">
<table style="display:none">
<tr>
<td>待显示数据1
</td>
<td>待显示数据2
</td>
<td>待显示数据3
</td>
<td>待显示数据4
</td>
</tr>
</table>
</td>
<tr>
这个时候通过table中的style的display来控制显示与否.
分享到:
相关推荐
<td>body c</td> <br> <td>body d</td> <br> </tr> <br> <tr> <br> <td>body a</td> <br> <td>body b</td> <br> </tr> <br> <tr> <br> <td>body c</td> <br> <td>body d</td> <br> </tr> <br> <tr> <br> <td>body a...
<div class="top">我的网页设计作业</div> <div id="MainMenu" class="ddsmoothmenu"> <ul> <li><a href="index.html" title="个人主页" id="menu_selected"><span>个人主页</span></a></li> <li><a href=...
<li><a href="#"><img src="images/ad4.jpg" thumb="" alt="" text="详细描述4" /></a></li> <li><a href="#"><img src="images/ad3.jpg" thumb="" alt="" text="详细描述5" /></a></li> </ul> </div>
<td><div align="center"><a href="showdetail.jsp?id=%=rs.getString(">"><%=rs.getString("title") %></a><br> </div></td> <td><div align="center"><%=rs.getString("time") %><br> </div></td> </tr> ...
background=/images/index_24.jpg> <DIV align=center>热门文章</DIV></TD> <TD class=baiheicu width="19%" background=/images/index_24.jpg> </TD> </TR> </TBODY> </TABLE></TD> </TR> <TR> <TD...
<%@ page language="java" import="java.util.*" pageEncoding="GBK"%> <%@ taglib uri=... <div><c:import url="BodyFoot.jsp"></c:import></div> </center> </body> </html>
<td width=20></td> <td> <div class="diyselect" id="cs2"> <ul class="hidden"> <li>运营部</li> <li selected="selected">设计部</li> <li>客服部</li> ...
<tr> <td><div align="center">Email地址</div></td> <td><div align="left"> <%=email%><%=select%></div></td> </tr> <tr><td><div align="center">登录密码</div></td><td><div align="left"><%=pwd%></div></td>...
<div align="center"> <h1> 添加手机信息 </h1> <form action="addphoneAction.jsp" method="post"> <table border="1"> <tr> <th> 类型: </th> <td> ...
这个一个CSS padding和margin的例子,对初学者很有帮助的哦~ .divcss3{border:1px solid #F00;... <tr><td>test数据</td></tr> <tr><td>test数据</td></tr> <tr><td>test数据</td></tr> </table> </div>
<div id="annextableList1"> <table width="800" border="1"> <caption align="left"> SubTable List </caption> <tr> <th style="background-color:#e5e5e5"> Field...
<td colspan="2">1、天空软件站仅对原软件包“依样”打包,仅增加此说明文件,不保证所提供软件或程序的完整性和安全性。</td> </tr> <tr> <td height="30"> </td> <td>2、请在使用前查毒 (这也是您使用...
<td width="177" height="45" class="STYLE2"><div align="center" class="STYLE4">D片区</div></td> </tr> <tr> <td width="177" height="45" class="STYLE2"><div align="center" class="STYLE4">E片区</div>...
<td width="130" rowspan="6"><div align="center"> <?php if(trim($info[tupian]=="")) { echo "暂无图片"; } else { ?> <img src="<?php echo $info[tupian];?>" width="130" height="100" border="0"> ...
<option>学生</option><option>一年</option><option>二年</option><option>三年</option><option>三年到五年</option><option>五年到十年</option><option>十年以上</option> </select> </div> ...
</div> <p> <asp:CheckBox ID="CheckBox1" runat="server" Checked="True" Text="记住密码" /> <asp:Button ID="Button1" runat="server" onclick="Button1_Click" Text="登录" /> </p> </form> </body> </...
<% if session("ok")<>"" then %> <form id="form3" name="form3" method="post" action=""> <table width="98%" border="1" cellspacing="0" cellpadding="0"> <tr> <td colspan="2"><div align="center">发表...
<style>#top a img{ border:0px; background: none repeat scroll 0 0 #ffffff;} #top a:hover img{ opacity: 0.3;cursor:hand; background: none repeat scroll 0 0 #000000;}</style> <div class="mc" style=";min...
<div class="find"><button type="submit" class="sub"><span><img src="images/fd.jpg" /></span></button> </div> </form> </div> </div> <div id="mnu"> <table style="margin-top:10px;margin-left:5px;...
<dd><a ><div class="mouse_s"><img /><p>1瑞马公司</p></div><div class="hover_s"><img /><p>1瑞马公司</p></div></a></dd> <dd><a ><div class="mouse_s"><img /><p>展览项目</p></div><div class="hover_s...