You are here: Re: Removing space between cells in table « HTML « IT news, forums, messages
Re: Removing space between cells in table

Posted by Jonathan N. Little on 08/16/06 17:56

Bundy wrote:
> Sorry for asking this but I cannot seem to get rid of the space between
> the cells.
>
> I have search various websites and newsgroups. I bet it is something
> obvious.
>
> <html xmlns="http://www.w3.org/1999/xhtml">
> <head>
> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
> <title>Testing</title>
>
> </head>
>
> <body>
> <table width="100%" height="400">
> <tr>
> <td bgcolor="#00FF33" border="0" cellpadding="0"
> cellspacing="0">&nbsp;</td>
> <td bgcolor="#FFFF00" border="0" cellpadding="0"
> cellspacing="0">&nbsp;</td>
> <td bgcolor="#FF00FF" border="0" cellpadding="0"
> cellspacing="0">&nbsp;</td>
> </tr>
> </table>
> </body>
> </html>
>

CSS to the rescue! Stop trying to do it with presentational markup and
learn about stylesheets:


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>Using CSS</title>

<style type="text/css">
TABLE { border-collapse: collapse; width: 100%; height: 400px; }
.example1 {color: #000000; background-color: #00ff33;}
.example2 {color: #000000; background-color: #ffff00;}
.example3 {color: #000000; background-color: #ff00ff;}
</style>
</head>
<body>
<table>
<tr>
<td class="example1">&nbsp;</td>
<td class="example2">&nbsp;</td>
<td class="example3">&nbsp;</td>
</tr>
</table>
</body>
</html>

--
Take care,

Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация