想用table实现这样的布局_html/css_WEB-ITnose

WBOY
Release: 2016-06-21 09:43:56
Original
1133 people have browsed it

table 布局

想用表格实现这样的布局,求代码。

回复讨论(解决方案)

看不见你的图啊  卡卡西老师

直接用表格完成就可以.插入表格...

看不见你的图啊  卡卡西老师
图片:

嵌套一下
边框处理一下就是了

<table width=300><tr><td><table width=100%><tr><td width=50%>1</td><td width=50%>2</td></table></td></tr><tr><td><table width=100%><tr><td width=33%>3</td><td width=33%>4</td><td width=33%>5</td></table></td></tr></table>
Copy after login

add css:

table{     border-collapse:collapse;    margin:-1px;}.out td {    border:1px gray solid;}.in1 td,.in2 td{    border:none;}.in1 td:first-child,.in2 td:not(:last-child){    border-right:1px solid red;}
Copy after login

用表格还是有点麻烦,以后更改费事一点,div好点

有个方法,不用嵌套表格。

<table width="900" height="200" border="0" align="center" cellpadding="0" cellspacing="3" bgcolor="#000000">  <tr>    <td colspan="2" bgcolor="#AAFFCC"> </td>    <td colspan="2" bgcolor="#AAFFCC"> </td>  </tr>  <tr>    <td width="286" bgcolor="#AAFFCC"> </td>    <td colspan="2" bgcolor="#AAFFCC"> </td>    <td width="288" bgcolor="#AAFFCC"> </td>  </tr></table>
Copy after login
Copy after login

DIV欢迎您:

<html>	<head>		<title>图片布局</title>	</head>	<body>	  <div style="float:left;width:100%;height:100%"> 	    <div style="float:left;width:100%;height:50%;"> 	       <img    style="max-width:90%" src="mr.jpg"/ alt="想用table实现这样的布局_html/css_WEB-ITnose" > 	       <img    style="max-width:90%" src="mr.jpg"/ alt="想用table实现这样的布局_html/css_WEB-ITnose" > 	    </div>  	    <div style="float:left;width:100%;height:50%;"> 	      <img    style="max-width:90%" src="mr.jpg"/ alt="想用table实现这样的布局_html/css_WEB-ITnose" >  	      <div style="float:right;width:66.66%;height:100%;"> 	         <img    style="max-width:90%" src="mr.jpg"/ alt="想用table实现这样的布局_html/css_WEB-ITnose" >  	         <img    style="max-width:90%" src="mr.jpg"/ alt="想用table实现这样的布局_html/css_WEB-ITnose" > 	      </div> 	    </div> 	  </div> 	</body></html>
Copy after login

有个方法,不用嵌套表格。

<table width="900"  style="max-width:90%" border="0" align="center" cellpadding="0" cellspacing="3" bgcolor="#000000">  <tr>    <td colspan="2" bgcolor="#AAFFCC"> </td>    <td colspan="2" bgcolor="#AAFFCC"> </td>  </tr>  <tr>    <td width="286" bgcolor="#AAFFCC"> </td>    <td colspan="2" bgcolor="#AAFFCC"> </td>    <td width="288" bgcolor="#AAFFCC"> </td>  </tr></table>
Copy after login


用table这个是正解吧,

有个方法,不用嵌套表格。

<table width="900" height="200" border="0" align="center" cellpadding="0" cellspacing="3" bgcolor="#000000">  <tr>    <td colspan="2" bgcolor="#AAFFCC"> </td>    <td colspan="2" bgcolor="#AAFFCC"> </td>  </tr>  <tr>    <td width="286" bgcolor="#AAFFCC"> </td>    <td colspan="2" bgcolor="#AAFFCC"> </td>    <td width="288" bgcolor="#AAFFCC"> </td>  </tr></table>
Copy after login
Copy after login



+1

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
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!