On 01 May 2006 22:02:40 +0100 Chris Morris <c.********@dur ham.ac.uk> wrote:
|
ph************* *@ipal.net writes:
|> On 01 May 2006 12:41:20 +0100 Chris Morris <c.********@dur ham.ac.uk> wrote:
|> | Maybe you should use CSS and let people select their own preferred
|> | chess-board colours with alternative stylesheets. ;)
|>
|> Fine. Show how.
|
| <link rel="stylesheet " href="cbcolours .css?c1=ff0000; c2=000000"
| type="text/css">
| (where cbcolours.css is a script that parses the colours and returns a
| stylesheet, and the above <link> is also generated via scripting)
|
| Use of rel="alternate stylesheet" could let you do it without any
| scripting if you used only a few possible colour schemes.
|
|> | Well, again, CSS is not going to be more or less 'reliable' than HTML
|> | at positioning and providing the image (though CSS has more options).
|>
|> But how well can CSS choose which squares to color? If the browser
|> supports :first-child then you can color the top and left ones different.
|
| Well, if you were doing it with HTML you'd have to colour each cell
| individually anyway, so you don't lose anything by using CSS and you
| gain only having to change two values instead of 64 if you decide to
| use different colours.
You can be sure that changing the colors in HTML is easy and simple.
It's called substitution in an editor. And if that's not enough, one
can use a variable in PHP.
But that's all beyond the point.
CSS has to know more about the layout than simply a classified set of
elements. It has to know the nesting relationship in so many cases.
That's layout. Why should it be cross mixed in both style and content?
In all likelihood I would color a chessboard with CSS, but not because
it is theoretically the right way, but because it's a practical way.
However, the "CSS people" still often whine about the use of tables
|> for stuff that needs to be 2-D.
|
| People have different views on what is best expressed 2-D and what is
| best expressed 1-D. There's a grey area in which it would work either
| way, definitely.
|
| It doesn't help that the occasional person (as seen in the group
| archives) interprets "don't use tables for layout" as "don't use
| tables" or "don't use tables to lay out data with a relationship
| between the rows and columns"
How about something as simple as having a web page divided up into
3 major columns, and NOT wanting the rightmost column to fall down
underneath if the browser width is squeezed?
Tables do work when what is desired is some degree of rigidity.
Floats work great for other things in ways tables could never do.
|> Within an item, sure, it would basically be 1-D. But when categorizing
|> items, and ordering them by some priority or date, then you may want a
|> grid structure. And tables seems nature for it.
|
| I assume you mean something like
| <table>
| <thead><tr><th> Date</th><th>Title</th><th>Article< th></tr></thead>
| <tbody>...<!-- 1 news article per row -->...</tbody>
| </table>
| (exact column headings and even if the <thead> block needs to be
| explicitly displayed varying depending on exactly what you're doing,
| of course)
I was thinking more along the lines of:
<table>
<thead><tr>
<th>Category 1</th>
<th>Category 2</th>
<th>Category 3</th>
<th>Category 4</th>
</tr></thead>
<tbody><tr>
<td>
Article 1 in Category 1<hr>
Article 2 in Category 1<hr>
Article 3 in Category 1
</td>
<td>
Article 1 in Category 2<hr>
Article 2 in Category 2<hr>
Article 3 in Category 2
</td>
<td>
Article 1 in Category 3<hr>
Article 2 in Category 3<hr>
Article 3 in Category 3<hr>
Article 4 in Category 3
</td>
<td>
Article 1 in Category 4<hr>
Article 2 in Category 4<hr>
Article 3 in Category 4
</td>
</tr></tbody>
</table>
The <hr> between articles in an arbitrary example. In this case I want
the columns all lined up prefectly. But the Nth article in one column
does not need to be exactly beside the Nth article in another column.
| I don't think there's anything wrong with that (although if the full
| text of the news articles was being included in the table, I'd
| probably do it differently unless the full text was very short)
The text can vary since the flow is the full length of the columns.
--
-----------------------------------------------------------------------------
| Phil Howard KA9WGN |
http://linuxhomepage.com/ http://ham.org/ |
| (first name) at ipal.net |
http://phil.ipal.org/ http://ka9wgn.ham.org/ |
-----------------------------------------------------------------------------