HTML/CSS/Box Model/border collapse

Материал из Web эксперт
Перейти к: навигация, поиск

border-collapse:collapse

 

<?xml version="1.0" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
  <title>CSS Example</title>
  <style rel="stylesheet" type="text/css">
table.one {
  border-collapse: collapse;
}
td.a {
  border-style: dotted;
  border-width: 3px;
  border-color: #000000;
  padding: 10px;
}
td.b {
  border-style: solid;
  border-width: 3px;
  border-color: #333333;
  padding: 10px;
}
</style>
</head>
<body>
<h2>border-collapse:collapse</h2>
<table class="one">
  <tr>
    <td class="a">cell a collapse</td>
    <td class="b">cell b collapse</td>
  </tr>
  <tr>
    <td class="b">cell b collapse</td>
    <td class="a">cell a collapse</td>
  </tr>
</table>

</body>
</html>



border-collapse:separate

 

<?xml version="1.0" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
  <title>CSS Example</title>
  <style rel="stylesheet" type="text/css">
table.two {
  border-collapse: separate;
}
td.a {
  border-style: dotted;
  border-width: 3px;
  border-color: #000000;
  padding: 10px;
}
td.b {
  border-style: solid;
  border-width: 3px;
  border-color: #333333;
  padding: 10px;
}
</style>
</head>
<body>
<h2>border-collapse:separate</h2>
<table class="two">
  <tr>
    <td class="a">cell a separate</td>
    <td class="b">cell b separate</td>
  </tr>
  <tr>
    <td class="b">cell b separate</td>
    <td class="a">cell a separate</td>
  </tr>
</table>

</body>
</html>