PDA

View Full Version : Need HTML help



alecjw
September 25th, 2006, 11:59 PM
Hi. I've made a table in HTML, but there are transparent gaps between the cells. How do I push the cells togeter and get rid of these lines (using CSS)?

Thanks

GuitarHero
September 26th, 2006, 12:54 AM
just do it with html. cellspacing="0" in the table tag

maniacmusician
September 26th, 2006, 03:46 AM
unless there's a bunch of tables. then its easier to use css.

alecjw
September 26th, 2006, 04:25 PM
unless there's a bunch of tables. then its easier to use css.

I'm using XHTML srict. I can't use syle attrubutes such as border, bgcolor, cellspacing etc. I have to use CSS. What's the CSS attribute?

DirtDawg
September 26th, 2006, 05:30 PM
maybe {padding:0px} ?

alecjw
September 26th, 2006, 05:36 PM
maybe {padding:0px)?

Just curious, does using tables hold an advantage over a box model when using CSS?

Nope. It doesn't work. And I've never heard of a box model.

DirtDawg
September 26th, 2006, 05:45 PM
Nope. It doesn't work. And I've never heard of a box model.

Box model just means no tables. Everything is contained in <div> tags, which essentially act like boxes. Then you use CSS to layout the boxes in their desired spot. It's how I built my website(see sig), though I am a self taught hack.

Anyways, I'm not familiar with tables, but I have an Orielly CSS pocket guide here I'm using for reference. According to this thing, there's only padding and margins between each cel, if I'm understanding correctly. It sounds like there's strict rules concerning borders when more than one cel is adjacent.

For example, here's part of rule #3:

If at least one of the collapsing borders has a value other than NONE or HIDDEN,
then narrow borders lose out to wider ones...

Maybe the borders need tweaking?

DirtDawg
September 26th, 2006, 06:04 PM
Maybe this (http://www.safaribears.de/content.php?page=csstutorial&chap=7) is what you're looking for?
Something about a {border-collapse:collapse}

v8YKxgHe
September 26th, 2006, 06:15 PM
Have you got a link or could you post some code?

skymt
September 26th, 2006, 06:17 PM
If you're using XHTML you shouldn't be using tables for layout anyway. Read up on modern web design. The latest article (http://alistapart.com/articles/12lessonsCSSandstandards) on A List Apart (http://alistapart.com/) has some good advice. After that, read up on CSS at W3Schools (http://www.w3schools.com/).

v8YKxgHe
September 26th, 2006, 06:18 PM
Who said he's using tables for layout? But yes, Tables should _NOT_ be used for layouts, DIV + CSS is the way to go.

DirtDawg
September 26th, 2006, 06:20 PM
Have you got a link or could you post some code?

Sorry, the link was coded in the word "this". That probably wasn't very clear.

Here it is again:
http://www.safaribears.de/content.php?page=csstutorial&chap=7

v8YKxgHe
September 26th, 2006, 06:24 PM
hehe, sorry - I meant to the first poster who was asking for help,

skymt
September 26th, 2006, 06:25 PM
Who said he's using tables for layout? But yes, Tables should _NOT_ be used for layouts, DIV + CSS is the way to go.

If he's using tables to display tabular data, he'd want borders. Since he doesn't, he isn't.

DirtDawg
September 26th, 2006, 06:28 PM
hehe, sorry - I meant to the first poster who was asking for help,

oh right. DAR!

alecjw
September 26th, 2006, 06:32 PM
http://192.168.2.102/marsh/

I've tried border-width:0px, border-style:none and margin:0 and padding:0, none of which work.

alecjw
September 26th, 2006, 06:37 PM
Sorry, that's the local address. It's http://alecjw.no-ip.org/marsh/results.php

DirtDawg
September 26th, 2006, 06:48 PM
I fixed it by adding:
table {border-collapse:collapse;}

Of course, you'll likely want to refine it, and who knows if it works in IE, but that's a start.

alecjw
September 26th, 2006, 06:55 PM
Doesn't work in IE or Opera.

DirtDawg
September 26th, 2006, 07:06 PM
Doesn't work in IE or Opera.

Well short of a box model solution, I'm out of ideas. Sorry.

alecjw
September 26th, 2006, 07:15 PM
Just found out that cellspacing isn't depereceated! It's the only style attribute which isn't! (Presumably because of these browser incompatabilities)

v8YKxgHe
September 26th, 2006, 07:57 PM
If he's using tables to display tabular data, he'd want borders. Since he doesn't, he isn't.

Not always =)