Home  >  Article  >  Web Front-end  >  Why does border-spacing: 10px; in table not work?

Why does border-spacing: 10px; in table not work?

黄舟
黄舟Original
2017-06-30 10:03:323350browse

I use style sheet: table { border-collapse: separate; border-spacing: 10px; border:1px solid #000000; }, I want tableCell separation, but why does the set border-spacing not work? Please give me some advice

I just want to use CSS to achieve the following effect, but border-spacing: 10px; does not work

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
</head>

<body>
<table width="400" border="1" cellpadding="0" cellspacing="4" bordercolor="#000000">
  <tr>
    <td> </td>
    <td> </td>
    <td> </td>
    <td> </td>
    <td> </td>
  </tr>
  <tr>
    <td> </td>
    <td> </td>
    <td> </td>
    <td> </td>
    <td> </td>
  </tr>
  <tr>
    <td> </td>
    <td> </td>
    <td> </td>
    <td> </td>
    <td> </td>
  </tr>
</table>
</body>
</html>

I just want to use CSS to achieve the above effect. I don’t know how to use CSS to achieve the cellspacing="4" effect set in HTML. I tried border-spacing: 10px; but it didn’t work; please help me. Please give me some advice

ie+ff

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
<style type="text/css">
table.tt{border-spacing:10px;}
</style>
<!--[if IE]>
<style type="text/css">
table.tt{sheneyan:expression(this.cellSpacing="10");}
</style>
<![endif]-->
</head>

<body>
<table width="400" border="1" cellpadding="0" bordercolor="#000000" class="tt">
  <tr>
    <td> </td>
    <td> </td>
    <td> </td>
    <td> </td>
    <td> </td>
  </tr>
  <tr>
    <td> </td>
    <td> </td>
    <td> </td>
    <td> </td>
    <td> </td>
  </tr>
  <tr>
    <td> </td>
    <td> </td>
    <td> </td>
    <td> </td>
    <td> </td>
  </tr>
</table>
</body>
</html>

does not support
but why should we give up such a good built-in function of table.
Use css to complicate the table. .

The above is the detailed content of Why does border-spacing: 10px; in table not work?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
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