Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > Invisible tables with CSS

Reply
Thread Tools

Invisible tables with CSS

 
 
Philipp K
Guest
Posts: n/a
 
      11-28-2003
Hi,

I have the following problem: without CSS i would write this for an
invisible table which doesnt require any space.

<table border="0" cellspacing="0" cellpadding="0">


When i try it with CSS...

table
{
border-width: 0px;
padding: 0px;
border-spacing: 0px;
}

.... the tables width is bigger than a table with my non CSS version.

Any ideas what i have done wrong?
 
Reply With Quote
 
 
 
 
David Dorward
Guest
Posts: n/a
 
      11-28-2003
Philipp K wrote:
> <table border="0" cellspacing="0" cellpadding="0">
> When i try it with CSS...
> table { border-width: 0px; padding: 0px; border-spacing: 0px; }
>
> ... the tables width is bigger than a table with my non CSS version.
>
> Any ideas what i have done wrong?


You made the borders between cells touch, but you didn't collapse them (see
the border-collapse property), and you removed the padding from the table
(which doesn't have padding) but not the cells inside that table.

--
David Dorward http://dorward.me.uk/
 
Reply With Quote
 
 
 
 
Steve Pugh
Guest
Posts: n/a
 
      11-28-2003
Philipp K <(E-Mail Removed)> wrote:

>I have the following problem: without CSS i would write this for an
>invisible table which doesnt require any space.
>
><table border="0" cellspacing="0" cellpadding="0">
>
>
>When i try it with CSS...
>
>table
>{
> border-width: 0px;
> padding: 0px;
> border-spacing: 0px;
>}
>
>... the tables width is bigger than a table with my non CSS version.
>
>Any ideas what i have done wrong?


cellpadding is the padding inside the cells, so
td, th {padding: 0}
would be the equivalent.

IE doesn't support border-spacing, but
border-collapse: collapse
causes the same display as border-spacing: 0;

So,
<table border="0" cellspacing="0" cellpadding="0">

can be replaced by

table {border: none; border-collapse: collapse; border-spacing: 0;}
td, th {padding: 0;}

If you have non-zero cellspacing then it's best to stick with the HTML
until IE catches up with the rest of the universe.

cheers,
Steve

--
"My theories appal you, my heresies outrage you,
I never answer letters and you don't like my tie." - The Doctor

Steve Pugh <(E-Mail Removed)> <http://steve.pugh.net/>
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
CSS: invisible submit button, blasted IE itsastickup HTML 7 03-22-2009 10:51 AM
Making 1 control invisible while showing another in the exact location of the invisible one Andy B ASP .Net 5 05-29-2008 03:08 AM
Invisible - Succinic acid : (AMBER ACID) Invisible krithika.143@gmail.com C++ 0 04-14-2008 06:59 PM
CSS - images set to "invisible" - do they still download? RobM HTML 3 05-22-2006 11:56 AM
Text after 2 tables actually appears between 2 tables ! Peter Bassett HTML 3 08-15-2003 06:46 PM



Advertisments