Go Back   CodingForums.com > :: Client side development > HTML & CSS

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 04-10-2005, 07:40 AM   PM User | #1
ampulator00
New Coder

 
Join Date: Jun 2004
Posts: 95
Thanks: 0
Thanked 0 Times in 0 Posts
ampulator00 is an unknown quantity at this point
What is the CSS of equivalent of colspan and rowspan?

What is the CSS of equivalent of colspan and rowspan?

I tried row-span and col-span, but they don't work...

Just curious.
ampulator00 is offline   Reply With Quote
Old 04-10-2005, 08:39 AM   PM User | #2
chilipie
Senior Coder

 
chilipie's Avatar
 
Join Date: Jul 2004
Location: Shrewsbury, UK Age: 16
Posts: 1,117
Thanks: 0
Thanked 0 Times in 0 Posts
chilipie is an unknown quantity at this point
There isn't a CSS equivalent. If you think about it, the colspan and rowspan attributes make up the structure of the table, whereas CSS is for presentation, and HTML should be used for structural purposes.

Ollie .
chilipie is offline   Reply With Quote
Old 04-10-2005, 02:31 PM   PM User | #3
rpgfan3233
Regular Coder

 
Join Date: Mar 2005
Location: D0u$h!t3 k4?
Posts: 512
Thanks: 2
Thanked 5 Times in 5 Posts
rpgfan3233 is an unknown quantity at this point
I don't think the colspan and rowspan attributes will ever be removed. Although, a CSS3 Multi-Column Layout Module is currently available as a Working Draft (WD) in which a property known as 'column-span' is added, I don't believe that something like that will appear for a long time for tables.

Last edited by rpgfan3233; 04-10-2005 at 02:39 PM..
rpgfan3233 is offline   Reply With Quote
Old 04-10-2005, 04:21 PM   PM User | #4
ampulator00
New Coder

 
Join Date: Jun 2004
Posts: 95
Thanks: 0
Thanked 0 Times in 0 Posts
ampulator00 is an unknown quantity at this point
Or better yet, how do I use CSS to span content into two table cells instead of just one table cell?

Well, the the thing si, I was messing around with the CSS tablss model, and it works pretty much like a table, except that I cann't do the rowspan or colspan thing...

Last edited by ampulator00; 04-10-2005 at 04:24 PM..
ampulator00 is offline   Reply With Quote
Old 04-10-2005, 06:48 PM   PM User | #5
rmedek
Senior Coder

 
Join Date: Nov 2003
Location: Minneapolis, MN
Posts: 2,879
Thanks: 2
Thanked 65 Times in 56 Posts
rmedek is on a distinguished road
Quote:
Originally Posted by ampulator00
Or better yet, how do I use CSS to span content into two table cells instead of just one table cell?
You don't. It's just like Chilipie said-- tables are a way to structure content, CSS is a way to style content. If you're using a table you'd have to use the attributes of a table to get the data where it needs to be, by using rowspan and colspan.

There's a CSS model for a table-like display; in other words, there are display settings (like display: table-cell) that give a block level element the behavior of a table element (in this case, a table cell). But that's one element at a time, not an entire table.
__________________
drums | web
rmedek is offline   Reply With Quote
Old 04-10-2005, 08:21 PM   PM User | #6
ampulator00
New Coder

 
Join Date: Jun 2004
Posts: 95
Thanks: 0
Thanked 0 Times in 0 Posts
ampulator00 is an unknown quantity at this point
Quote:
Originally Posted by rmedek
You don't. It's just like Chilipie said-- tables are a way to structure content, CSS is a way to style content. If you're using a table you'd have to use the attributes of a table to get the data where it needs to be, by using rowspan and colspan.

There's a CSS model for a table-like display; in other words, there are display settings (like display: table-cell) that give a block level element the behavior of a table element (in this case, a table cell). But that's one element at a time, not an entire table.
so... I know that, but how would make it longer using html then, with the CSS tables model?

Last edited by ampulator00; 04-10-2005 at 08:33 PM..
ampulator00 is offline   Reply With Quote
Old 04-10-2005, 08:48 PM   PM User | #7
rpgfan3233
Regular Coder

 
Join Date: Mar 2005
Location: D0u$h!t3 k4?
Posts: 512
Thanks: 2
Thanked 5 Times in 5 Posts
rpgfan3233 is an unknown quantity at this point
With a lot of unnecessary work. The only time you would want to use "display: table-cell" is when you would want to keep the contents a block-level element, but display it like an inline element (in the same "row"). The 'colspan' and 'rowspan' attributes have no direct CSS equivalents and can only be used for table elements. They CANNOT be used for elements that would emulate them, such as DIVs. If you want to create 'colspan' or 'rowspan' using CSS, you must use the 'height' and 'width' properties.
rpgfan3233 is offline   Reply With Quote
Old 04-10-2005, 08:56 PM   PM User | #8
ampulator00
New Coder

 
Join Date: Jun 2004
Posts: 95
Thanks: 0
Thanked 0 Times in 0 Posts
ampulator00 is an unknown quantity at this point
Quote:
Originally Posted by rpgfan3233
With a lot of unnecessary work. The only time you would want to use "display: table-cell" is when you would want to keep the contents a block-level element, but display it like an inline element (in the same "row"). The 'colspan' and 'rowspan' attributes have no direct CSS equivalents and can only be used for table elements. They CANNOT be used for elements that would emulate them, such as DIVs. If you want to create 'colspan' or 'rowspan' using CSS, you must use the 'height' and 'width' properties.
Thank you, for your suggestion.

I think I have solution to my problem; instead of putting the content that needs to span 2 columns, I simply decided to put it outside, and the break the one CSS table into several, more manageable CSS tables, and each time I have new content that spans twice, I put it outside, and make a new CSS table. Is that fine?
ampulator00 is offline   Reply With Quote
Old 04-10-2005, 08:57 PM   PM User | #9
rpgfan3233
Regular Coder

 
Join Date: Mar 2005
Location: D0u$h!t3 k4?
Posts: 512
Thanks: 2
Thanked 5 Times in 5 Posts
rpgfan3233 is an unknown quantity at this point
Why not just use 'colspan'? It isn't forbidden, deprecated, or anything like that.
Even in the WD of XHTML2 (which is meant to be NOT backwards-compatible), those attributes are still there:
http://www.w3.org/TR/xhtml2/mod-tables.html#sec_26.6.1.
rpgfan3233 is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

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

Forum Jump


All times are GMT +1. The time now is 07:43 PM.


Advertisement
Log in to turn off these ads.