rowspan/colspan in CSS? Does it exist?

K

Kris

Joshua Beall said:
Does CSS allow you to specify the row or column span for a table cell?

No. It is a structural issue and that is what HTML is for, not CSS. You
don't happen to use tables to layout your site, do you?
 
D

David Dorward

Joshua said:
Does CSS allow you to specify the row or column span for a table cell?

No, CSS is a presentation language. colspan and rowspan describe a
structural relationship (i.e. this cell relates to this row/col and the
next X rows/cols).
 
R

Rob McAninch

Kris
No. It is a structural issue and that is what HTML is for, not
CSS. You don't happen to use tables to layout your site, do
you?

Is layout structure or presentation?
 
M

Mark Parnell

Is layout structure or presentation?

Presentation.

E.g:
Structure: This is a paragraph (or list, table, etc.)
Presentation: This should be this colour (font, be on the right, etc.)
 
K

Kris

No. It is a structural issue and that is what HTML is for, not
CSS. You don't happen to use tables to layout your site, do
you?

Is layout structure or presentation?[/QUOTE]

Visual presentation. It can look 'structurised' though. Compared to a
building, it has an internal structure that often is not visible to the
eye; on the outside you see brick, glass, balconies, etcetera. There are
also architectural styles that make the structure of a building visible
on the outside, like Centre Pompidou in Paris. Nevertheless, the
structure not there for visuals. It holds the building together.
Presentation is 'how it looks on the outside'.
 
B

Barry Pearson

Rob said:
Kris


Is layout structure or presentation?

I think it is ambiguous. See, for example, what the HTML recommendation says
about "Structure and presentation" for tables.
http://www.w3.org/TR/html401/appendix/notes.html#notes-tables

I think, over the years, there has been a change in mind-set on this. A decade
ago, discussions about stylesheets were mainly about the the detailed
rendering of the material, rather than its top-level presentation on a page or
screen. There were exceptions, such as a proposal for "columns" as a
stylesheet layout feature. But people talking about what stylesheets were for
tended to give examples about fonts & colours, etc. So you laid it out
somehow, then styled it with a stylesheet. (And "columns" haven't yet been
recommended in CSS, although there are proposals. In other words, it is
recognised that a specific layout-need has not yet been satisfied by CSS).

For example, here was a discussion from 1993:
http://ksi.cpsc.ucalgary.ca/archives/WWW-TALK/www-talk-1993q2.messages/443.html

Category | Style Name:

character rendering > font
object justification > justify
page layout > column
break behavior > break
special marks > mark
vertical object layout > vert
horizontal object layout > indent
links contained in objects > link

Gradually, some people are placing "layout" strongly in the "presentation"
category. But I suspect they are doing so to an extent that the pioneers would
not recognise.
 
G

GD

Richard said:
row/col span is not necessary in css.

There is in a way. As it stands, there is no property for spanning
elements being displayed as cells by using display:table-cell

At the moment CSS tables are only useful for creating basic grids.

Opera 4 and above (not tested in 7 yet) respects the colspan and
rowspan attributes on the elements you display as table cells but
this is not part of any spec and it doesn't work in Mozilla, the
only other browser that does CSS tables:

<div style="display:table; margin:2em">
<h3 style="display:table-caption">What's Mozilla doing?</h3>
<div style="display:table-row">
<p style="display:table-cell" colspan="2">AB</p>
<p style="display:table-cell">C</p>
</div>
<div style="display:table-row">
<p style="display:table-cell">D</p>
<p style="display:table-cell">E</p>
<p style="display:table-cell">F</p>
</div>
</div>


However, with regard to the original post, if you're using real table
elements then you should be spanning with the relevant attributes, not
CSS.
 
R

Rob McAninch

Barry Pearson said:
Is layout structure or presentation?

I think it is ambiguous. [...]

I agree.
Gradually, some people are placing "layout" strongly in the
"presentation" category. But I suspect they are doing so to an
extent that the pioneers would not recognise.

The HTML has some implicit presentation, at the most basic you
have block level and inline elements. Some elements fit both
categories (e.g. the INS element). And then there is the
'default' behavior that HTML gets in a visual browser.

So we have HTML (or maybe XML) to denote structure, CSS to style
the presentation, perhaps we need a third language for layout?
:)
 
B

Barry Pearson

Rob said:
Barry Pearson said:
Is layout structure or presentation?

I think it is ambiguous. [...]

I agree.
Gradually, some people are placing "layout" strongly in the
"presentation" category. But I suspect they are doing so to an
extent that the pioneers would not recognise.

The HTML has some implicit presentation, at the most basic you
have block level and inline elements. Some elements fit both
categories (e.g. the INS element). And then there is the
'default' behavior that HTML gets in a visual browser.

So we have HTML (or maybe XML) to denote structure, CSS to style
the presentation, perhaps we need a third language for layout?
:)

I've suggested that elsewhere. It isn't necessarily that the syntax of CSS is
wrong for the purpose. It may simply be that the current set of properties &
values are inadequate. I haven't thought about it enough to judge.

I believe you would know that you had a page / viewport layout language if you
could look at the layout sheet (whether CSS or something else) and deduce what
the page and/or viewport would look like without reference to the HTML. That
would be *true* separation of layout from mark-up.

But, at the moment, except for relatively simple pages where there may simply
be about 4 elements to be positioned, you need to know the wrapping & nesting
& sequencing of the "outer" 5 to 10 elements in order to judge. I've looked at
large numbers of layouts, many of them by people who would be judged to be
experts, and this is common. Often they even have IDs such as "wrapper", etc.

When I am designing a new tableless-layout, a lot of thought goes into those
outer elements, and their corresponding CSS. They are what makes one layout
significantly different from another. Which means that part of the layout gets
frozen into the HTML. It isn't so much that the layout is relying on the
default layout of those elements. It is that CSS is often heavily dependent on
nesting, for positioning and other reasons. (It isn't an accident that the W3C
CSS validator reminds us that getting the required styles needs a proper
document parse tree).

People talk about table-layout versus tableless-layout. Perhaps they ought to
be talking about layout-neutral mark-up. Often, "wrapping with <td>s" is
replaced with "wrapping with <div>s". It often provides more options via CSS
alone, but rarely real separation.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,022
Latest member
MaybelleMa

Latest Threads

Top