Tuesday, August 20, 2013

CSS table borders distance

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<style type="text/css">
table.ex1
{
border-collapse:separate;
border-spacing:10px;
}
table.ex2
{
border-collapse:separate;
border-spacing:10px 50px;
}
</style>
</head>

<body>
<table class="ex1" border="1">
<tr>
<td>Munirul</td>
<td>Hasan</td>
</tr>
<tr>
<td>Shahin</td>
<td>Tuhin</td>
</tr>
</table>
<br />

<table class="ex2" border="1">
<tr>
<td>Mahbubur</td>
<td>Rahman</td>
</tr>
<tr>
<td>Musa</td>
<td>Isa</td>
</tr>
</table>

<p><b>Note:</b> Internet Explorer supports the border-spacing property only if a !DOCTYPE is specified!</p>
</body>
</html>

Result


No comments: