Heim  >  Artikel  >  Web-Frontend  >  关于表格table的td内容为空时边框不能显示_html/css_WEB-ITnose

关于表格table的td内容为空时边框不能显示_html/css_WEB-ITnose

WBOY
WBOYOriginal
2016-06-24 12:11:291598Durchsuche

我的代码如下:

<table class="right_table" border="1" cellpadding="1" cellspacing="0">CSS代码:[code=CSS].right_table {	width:700px;	border-bottom:5px solid #999;	border-left:3px solid #ccc;	border-top:3px solid #ccc;	border-right:5px solid #999;}
[/code]


回复讨论(解决方案)

<!DOCTYPE HTML><html>	<head>		<meta charset="gb2312" />		<title></title>		<style>			table {				border-collapse:collapse;			}			td {				border:1px solid red;			}		</style>	</head>	<body>		<table>			<tr>				<td>1-1--1</td>				<td>1-1--1</td>			</tr>			<tr>				<td>1-1--1</td>				<td></td>			</tr>					</table>	</body></html>



关键
border-collapse:collapse;

td必须要有个站位   也行啊  你不输东西边框不出来的 
你拿工具生成的表格td里不也是个空格吗?
你在怎么修改样式也没用  td里必须要有东西  这是规定!!铁的!!

border-collapse:collapse;
是关键。

Stellungnahme:
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn