473,386 Members | 1,828 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Specifying tabular position with CSS

Hello!

I could arrange some HTML elements so that they have a sensible order
without stylesheets:

<div id="sections">
<div id="content"> The bulk of the content that people actually want to read </div>
<div id="navigation"> Some short site map </div>
<div id="gumph"> Adverts and stuff... </div>
</div>

....and then set CSS to present these in a table (with 'display:
table-cell' etc) to achieve a three-column layout, but the components
will appear in their HTML order. If I want #content in the middle, or
some other re-ordering, perhaps with extra rows (e.g. navigation on
top), it seems I need CSS3 features, still under development. Any way
to do it with CSS2?

Can the move-to property only be used to defer content, and not to send
it back up the document? I don't suppose this is a big problem, since a
move up could always be expressed as moving everything else down,
right? Also, it might help when a 'content: pending()' is associated
with a non-id selector (since there could be multiple matching
elements), right?

Is there a way to set the row- or column-span of a CSS table cell? And
to generate a pseudo-element around a group of sibling elements (which
could then be declared as a table-row)?

Thanks,

Steven

--
ss at comp dot lancs dot ac dot uk
Nov 10 '05 #1
6 1640
Steven Simpson <ss@domain.invalid> wrote:
I could arrange some HTML elements so that they have a sensible order
without stylesheets:

<div id="sections">
<div id="content"> The bulk of the content that people actually want to read </div>
<div id="navigation"> Some short site map </div>
<div id="gumph"> Adverts and stuff... </div>
</div>

...and then set CSS to present these in a table (with 'display:
table-cell' etc) to achieve a three-column layout,
Given that IE doesn't support the CSS table model, I assume that this is
not a web site and/or that you are not supplying styling for IE?
but the components
will appear in their HTML order. If I want #content in the middle, or
some other re-ordering, perhaps with extra rows (e.g. navigation on
top), it seems I need CSS3 features, still under development. Any way
to do it with CSS2?
Floating and absolute positioning are the only CSS2 ways that allow
content to be displayed in a different order than listed in the HTML.
Needless to say that both methods deprive you of the features offered by
tables.
Can the move-to property only be used to defer content, and not to send
it back up the document?
The "move-to" property is part of the CSS3 proposals, afaik no browser
has implemented it.
Is there a way to set the row- or column-span of a CSS table cell?
The CSS2 table model does not provide for that.
And
to generate a pseudo-element around a group of sibling elements (which
could then be declared as a table-row)?


Not sure what you mean by that. If needed the CSS table model auto
generates anonymous elements to complete a CSS table as per the rules
laid out in the spec. You cannot target anonymously generated elements,
thus you cannot attach styling properties to them.

--
Spartanicus
Nov 10 '05 #2
Spartanicus wrote:
Given that IE doesn't support the CSS table model, I assume that this is
not a web site and/or that you are not supplying styling for IE?

No, I'm just looking theoretically at approaches to achieve popular
layouts while still properly separating style from content. I'm
exploring and checking my understanding of the CSS table approach.

Floating and absolute positioning are the only CSS2 ways that allow
content to be displayed in a different order than listed in the HTML.
As I thought.

The "move-to" property is part of the CSS3 proposals, afaik no browser
has implemented it.

I realise that. I should have indicated that it was a question on the
theory/intention of the property, not its current implementation.
Is there a way to set the row- or column-span of a CSS table cell?

The CSS2 table model does not provide for that.

I thought so, but also that perhaps I had missed something.

You cannot target anonymously generated elements,
thus you cannot attach styling properties to them.

In CSS3, ::outside, ::before and ::after are proposed to generate
anonymous elements, to which style can be applied, but ::outside only
goes around a single (non-generated) element. I couldn't see a way to
extend it over the original element's siblings.

Thanks,

Steven

--
ss at comp dot lancs dot ac dot uk
Nov 10 '05 #3
Steven Simpson <ss@domain.invalid> wrote:
Given that IE doesn't support the CSS table model, I assume that this is
not a web site and/or that you are not supplying styling for IE?

No, I'm just looking theoretically at approaches to achieve popular
layouts while still properly separating style from content. I'm
exploring and checking my understanding of the CSS table approach.


Note that CSS table layouts have the same problems as HTML tables, minus
the semantic problem. Reflows and/or delayed rendering that are common
with the automatic table layout model are a big part of that. This can
be remedied by selecting the fixed table layout model, but that destroys
many of the behaviors that many people find so appealing about using
tables for layout.

Content that is supposed to be "moved", as might become possible with
the CSS3 move-to property, is only going to make reflow and/or delayed
rendering problems worse, especially when the content is external.

Perhaps the promised CSS3 "advanced layout" module will address some of
these issues, unfortunately it is not publicly known if any work has
been carried out on that module.
The "move-to" property is part of the CSS3 proposals, afaik no browser
has implemented it.

I realise that. I should have indicated that it was a question on the
theory/intention of the property, not its current implementation.


In that case I'll pass on commenting further, my interest is mostly
limited to CSS methods that have at least one implementation.

--
Spartanicus
Nov 10 '05 #4
"Steven Simpson" <ss@domain.invalid> wrote
I could arrange some HTML elements so that they have a sensible order
without stylesheets:

<div id="sections">
<div id="content"> The bulk of the content that people actually want to read </div> <div id="navigation"> Some short site map </div>
<div id="gumph"> Adverts and stuff... </div>
</div>

...and then set CSS to present these in a table (with 'display:
table-cell' etc) to achieve a three-column layout, but the components
will appear in their HTML order. If I want #content in the middle, or
some other re-ordering, perhaps with extra rows (e.g. navigation on
top), it seems I need CSS3 features, still under development. Any way
to do it with CSS2?
SNIPPED
Is there a way to set the row- or column-span of a CSS table cell? And
to generate a pseudo-element around a group of sibling elements (which
could then be declared as a table-row)?


I would recommend the following approach

a) choose the width of the left and right columns, and which content you
want in each.
b) set up the left and right styles as follows

#left1, #left2 {width: (the width you chose); float: left}
#right1, #right2 {width: (the width you chose); float: right}

c) set up the content bits (or whatever is in the middle - nav, ads or
whatever) style as follows

#content1, #content2 {margin-left: (width you chose for the left column);
margin-right: (width you chose for the right column)}

Hopefully that should work. If not, I recomend http://www.alistapart.com/ as
that has something on 3 column layouts I think.

Martin

--
Martin Eyles
ma**********@NOSPAM.bytronic.com
Nov 23 '05 #5
Hello!

Martin Eyles wrote:
"Steven Simpson" <ss@domain.invalid> wrote
...and then set CSS to present these in a table (with 'display:
table-cell' etc) to achieve a three-column layout,
I would recommend the following approach

a) choose the width of the left and right columns,
I'm looking at the (CSS) table approach in order to avoid (what appears
to be) an arbitrary choice of width.
I recomend http://www.alistapart.com/ as
that has something on 3 column layouts


Hmm, I wouldn't recommend it as an example of a good web design,
however. Reduced font size for the main text; and too wide for my
browser window. Eugh!

Thanks anyway! :)

--
ss at comp dot lancs dot ac dot uk
Nov 23 '05 #6
"Steven Simpson" <ss@domain.invalid> wrote in message
news:dl**********@news.freedom2surf.net...
Hello!
Hi!
Martin Eyles wrote:
"Steven Simpson" <ss@domain.invalid> wrote
...and then set CSS to present these in a table (with 'display:
table-cell' etc) to achieve a three-column layout,
I would recommend the following approach

a) choose the width of the left and right columns,
I'm looking at the (CSS) table approach in order to avoid (what appears
to be) an arbitrary choice of width.


In that case, I think that the only ways of doing 3 columns in just css are
either the method suggested, or using absolute positioning for the lot
(involves fixing even more widths). The other methods require putting the
HTML in a specific order, and then in divs. (one for each column).

I'm not even sure if CSS3 helps much, as the columns feature is really for
flowing text in columns rather than page layout. Then again, I might have
missed some of the features, as I only fiddled with it briefly for one page
on my personal site.
I recomend http://www.alistapart.com/ as
that has something on 3 column layouts


Hmm, I wouldn't recommend it as an example of a good web design,
however. Reduced font size for the main text; and too wide for my
browser window. Eugh!


Yeah, I know what you mean, only really works at 1024x768 and up. It is a
shame they made the shift to 4 faux columns (I don't think the left column
is a proper column), as they used to have a much better (accesibility wise)
2 column layout. Still, if you can get round this (turn off the styles,
should be able to see it in a narrower window without trouble, as the
underlying HTML is OK), many of the articles are worth looking at (they're
not all written by the person who came up with the latest stylesheet of the
site).
Thanks anyway! :)
No Problem
ss at comp dot lancs dot ac dot uk


ooooooh, proper comp sci guy, are you the department webmaster?

Ciao,
Martin

--
Martin Eyles
ma**********@NOSPAM.bytronic.com
Nov 23 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Terry | last post by:
I'd like to build a table-less layout for a very simple page. The layout should look a bit like this (view with fixed font) +-------------+ ID: 2984884 | | Last Name: Doe | ...
20
by: Karl Smith | last post by:
I heard a rumour that Opera succeeded where none have before, and implemented the tables described in HTML4 and CSS2. So I thought I'd try it out with the well known Periodic Table. ...
11
by: Alec S. | last post by:
Hi, Is it possible to create a colored box like this? : <html> <head> <style type="text/css"> #bbb { background: #f00; position: absolute;
4
by: bobdedogh | last post by:
can anyone add live hyperlinks to the sortable table made by the code supplied by Machi, or know of a simple alternative bob Machi wrote Mar 10 1999, 8:00 am >>>>>>>>>>>>>> .... Hello...
1
by: Christopher | last post by:
Hi... I would be very grateful If You could resolve my question, my question is "How do tabular a ListBox that their property DrawMode is OwnerDrawFixe?". I do know as tabular a listbox, but I...
1
by: CrazeUK | last post by:
Hi, First thanks in advance. I am using the board quite frequently now. I have a DB with multiple tables. Table 1: Main details table Table 2: Notes Table 3: Files affected I want to be able...
38
by: Sanders Kaufman | last post by:
I'm converting my table-based layouts to css-positioned divs - but the ONLY reason I'm doing it is because it's *considered* a best practice. I don't really see where anything goes hinky when...
5
by: Lars Eighner | last post by:
Is a calendar tabular data, logically meriting table markup? -- Lars Eighner <http://larseighner.com/ <http://myspace.com/larseighner> Countdown: 465 days to go. What do you do when...
1
by: sharan | last post by:
Using the expat parser (http://expat.sourceforge.net/) i have to parse the following xml file and print it on the screen in tabular format using C language. i am getting ouput serially but not in...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.