Glubase - share your knowledge


All / Computers / Programming / CSS





  • View Command

CSS Reference

CSS border-spacing definition

Browser support
IEFFOpSaf

Type:

Syntax

border-spacing: <length>;

Description

This property defines the distance that separates cell borders.

Values

Value Description
length<unit> length<unit> For example: "border-spacing: 5px 10px;". The unit can be any of px (pixels), mm (millimeters), cm(centimeters), in (inches), pt (points), pc (picas), em (the element's font height) or ex (the element's x-height).

Example

[Try this example yourself]
<style type="text/css">


table.one 
{
  border-spacing: 10px
}

table.two
{
  border-spacing: 10px 50px
}
</style>

<table class="one" border="1">
  <tr>
    <td>First</td>
    <td>Second</td>
  </tr>
  <tr>
    <td>Third</td>
    <td>Fourth</td>
  </tr>
</table>

<br />

<table class="two" border="1">
  <tr>
    <td>First</td>
    <td>Second</td>
  </tr>
  <tr>
    <td>Third</td>
    <td>Fourth</td>
  </tr>
</table>

Output

First Second
Third Fourth

First Second
Third Fourth
  • Comments

No comments added.