Welcome to WebmasterWorld Guest from 3.209.80.87

Forum Moderators: not2easy

Message Too Old, No Replies

Colspan In CSS

     
10:40 pm on Apr 17, 2004 (gmt 0)

Junior Member

10+ Year Member

joined:Apr 11, 2004
posts:71
votes: 0


how do you do colspan in css
10:49 pm on Apr 17, 2004 (gmt 0)

Junior Member

10+ Year Member

joined:Aug 22, 2003
posts:127
votes: 0


I don't think there is an equivalent to colspan in CSS. I'm pretty sure that since the w3c does not want tables used in layout then there is no reason for having a CSS equivalent of colspan. BTW colspan is valid XHTML, so I don't know of any reasons why it shouldn't be used.

I have a question also, what are reasons to avoid using colspan?

10:51 pm on Apr 17, 2004 (gmt 0)

Junior Member

10+ Year Member

joined:Apr 11, 2004
posts:71
votes: 0


o my mistake im trying to validate my page i got the wrong error..... what do i use instead of tables then
11:40 pm on Apr 17, 2004 (gmt 0)

Junior Member

10+ Year Member

joined:Aug 22, 2003
posts:127
votes: 0


I was wrong. There is a way to do it in CSS but it's not supported in most browsers. I just found this topic about colspan: [webmasterworld.com...]
11:48 pm on Apr 17, 2004 (gmt 0)

Junior Member

10+ Year Member

joined:Apr 11, 2004
posts:71
votes: 0


would i be able to create the page using no tables at all and if so what do i need to look at
12:11 pm on Apr 18, 2004 (gmt 0)

Junior Member

10+ Year Member

joined:Aug 22, 2003
posts:127
votes: 0


would i be able to create the page using no tables at all

It depends on which kind of design you have. If you have a design that must be pixel-perfect than you might have some problems using CSS for positoing.

But I recommend that you try CSS and see if it will work for you.

Here are some links on Tables to CSS:
Is using CSS instead of tables really a good idea? [webmasterworld.com]
How do you layout using CSS instead of tables? [webmasterworld.com]
Considering site redesign using CSS instead of tables for layout [webmasterworld.com]
Should I go Tableless with CSS? [webmasterworld.com]
CSS vs Table [webmasterworld.com]
No tables/Just CSS How? [webmasterworld.com]
CSS vs Tables Discussion [webmasterworld.com]
CSS: Is it Prime Time? [webmasterworld.com]

After that you can start your journey into the wonderful world of CSS at the CSS Forum [webmasterworld.com].
Also be sure to check out the CSS Forum Library [webmasterworld.com]

Have fun,

Elijah

12:45 pm on Apr 18, 2004 (gmt 0)

Junior Member

10+ Year Member

joined:Apr 11, 2004
posts:71
votes: 0


yeah i have moved to css but i am having some problems....can you see the other forum post i made im having a few problems
10:38 pm on Apr 18, 2004 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Feb 6, 2003
posts:661
votes: 0


quozt, I think the problem is that you are trying to create a page using CSS that looks as if it has been laid out using tables.

If you want to make something look like it has been laid out using tables, the easiest way is to use tables. The point of using CSS for layout is that you can create a fluid page, that adapts to the browser, screen resolution and window size that that are being used in viewing it. If CSS just duplicated the rigidity of tables-for-layout, there would be no point in using it.

1:43 am on Apr 19, 2004 (gmt 0)

Full Member

10+ Year Member

joined:Dec 25, 2003
posts:269
votes: 0


If CSS just duplicated the rigidity of tables-for-layout, there would be no point in using it.
The ability to have alternate style sheets and the related ability of having multiple pages all styled by a common file would be an advantage. The same document can be styled both ridgedly and fluidly by simply changing the style sheet.

The choice between CSS-colspan (where supported) and XHTML-colspan should be one of presentation vs. symantics. Part of the problem with tables, and the source of much of the layout debate, is that line between presentation and symantics gets very blurry. The fact is, with tables probably more than with almost any other element, the symantics virtually dictate much of the presentation.

2:06 pm on Apr 19, 2004 (gmt 0)

Junior Member

10+ Year Member

joined:Mar 11, 2004
posts:46
votes: 0


If someone wants their site to remain the same visually (converting from tables to CSS-P, but maintaining the look), but wants their code to be more efficient, then I see no reason why CSS shouldn't be used.
The whole point is to abolish tables for layout completely. Once CSS becomes second nature to you, it's not that hard to pull off any design.

I have been using CSS for a while now and studied the technical manual (specifications) over and over. I have created liquid sites, as well as converted sites from tables into css (while maintaining the look). Not all clients want to maintain the look though, which is better.

Yes CSS-P/CSS offers the chance to do different things, but i'm sick of seeing soooooo many clone css sites. No-one is experimenting enough, and people are too scared to used "boxes" anymore incase the "gurus" put them down. Just take a look at the drop shadow fad, everyone appears to be using it - because one person said it's nice.

The whole point of being a website designer is to style information in an easy to read, and easy to access way. So.. be creative everyone. Don't just follow what A-List Apart says, and put a bit of yourself into each site you make.

I stopped listening to the gurus and table designers along time ago, they both represent the extreme of either argument.

Keep in mind that by "stop listening" - I mean I stopped trying to be a clone of them.

lol hmmmm, dunno where all that came from... or if it's even relevant for this thread.

To the person who started the thread: Once you get past the CSS learning curve, you'll be fine. Tables should only be used for tabular layout. Creating practically ANY design is easy with css, once you know how ;)

2:44 pm on Apr 19, 2004 (gmt 0)

Senior Member

WebmasterWorld Senior Member drdoc is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Mar 15, 2002
posts:6807
votes: 0


There is a way to do it in CSS but it's not supported in most browsers.

...which could be because there currently is no way of doing it in CSS. It's suggested to be part of CSS3, but it is nowhere to be found in current recommendations.

2:54 pm on Apr 19, 2004 (gmt 0)

Junior Member

10+ Year Member

joined:Mar 11, 2004
posts:46
votes: 0


I see no point in a colspan property for CSS. If you're going to use colspan, you may as well stick to tables for layout. You see the colspan effect emulated in CSS almost everyday. The only thing missing are tables and the colspan properties :P

After all, a colspan is simply a cell/container stretched across two or more columns.

7:41 pm on Apr 20, 2004 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:June 9, 2003
posts:1908
votes: 0


Using CSS for colspan would really be superfluous for a couple reasons:

  1. colspan="2" is less code than whatever the CSS method might be,[/li]
  2. When would colspan change with a page's layout? I mean, yes, it might change, but you still couldn't add or remove cells without editing the table itself anyway.[/li]

There may be other reasons, but those are the ones that come instantly to mind. Colspan is an inherant property of table cells in relation to one another, and since CSS can't actually add or remove cells, then a CSS equivalent to colspan would only complicate matters.