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.
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..
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..
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.
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..
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.
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?
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.