![]() | |
#21
| |||||
| |||||
|
|
phil-news-nospam (AT) ipal (DOT) net writes: On 01 May 2006 12:41:20 +0100 Chris Morris <c.i.morris (AT) durham (DOT) 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. |
|
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" |
|
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 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) |
|
Phil Howard KA9WGN | http://linuxhomepage.com/ http://ham.org/ | (first name) at ipal.net | http://phil.ipal.org/ http://ka9wgn.ham.org/ | ----------------------------------------------------------------------------- |
#22
| |||
| |||
|
|
phil-news-nospam (AT) ipal (DOT) net> kirjoitti viestiss?:e35fio11vup (AT) news2 (DOT) newsguy.com... snip It probably comes down to the fact that my intentions in a grid structure do match the semantics of a table and tabular data. If it's tabular data, use table. It's that simple. |
|
If table is just there to do layout certain way when data is _NOT tabular_, don't, there are almost certainly better ways to do that layout. |
|
Phil Howard KA9WGN | http://linuxhomepage.com/ http://ham.org/ | (first name) at ipal.net | http://phil.ipal.org/ http://ka9wgn.ham.org/ | ----------------------------------------------------------------------------- |
#23
| ||||
| ||||
|
|
On Mon, 01 May 2006 19:29:26 +0100 Steve Pugh <steve (AT) pugh (DOT) net> wrote: | phil-news-nospam (AT) ipal (DOT) net wrote: |>On 01 May 2006 12:41:20 +0100 Chris Morris <c.i.morris (AT) durham (DOT) ac.uk> wrote: | |>| I'm having trouble thinking of a situation where you'd want a |>| background image of a chessboard (or a background grid in checkerboard |>| colours with the exact colour crucial) with text and images |>| superimposed. Could you give a bit more detailed example (with a URL |>| if you can) of the sort of thing you mean? | |>You want to color in CSS. Be my guest. Show how. But show CSS that |>can be used with any chess board in tables where only the table element |>has a class on it. | | A somewhat artificial restriction but here you go: | | http://steve.pugh.net/test/chessboard.html That's gross! |
|
| Works in Opera and FireFox and IE7, I presume it will work in Safari. | | As in many situations, IE6 and lower are the problem, not the CSS | spec. | | The amount of code can be reduce consideranly if you would allow | classes to be set on the <tr> elements. Well, I wanted it to be able to handle whatever size chess board that happens to be in the HTML. I should have said it in such a way. |
|
I think it comes down to whether identifying that specific positions have specific colors is a matter of content or style or ... layout. |
|
I just don't accept that the dividing line between CSS and HTML is really at where the theoretical dividing line between style and content would be. |
#24
| |||
| |||
|
|
On Tue, 2 May 2006 00:49:04 +0300 "W?rm" <nomailstodragon (AT) north (DOT) invalid> wrote: | If it's tabular data, use table. It's that simple. I cannot say that it _is_ tabular data. I can say that it needs the same _behaviour_ as tabular data. |
#25
| |||
| |||
|
|
I cannot say that it _is_ tabular data. I can say that it needs the same _behaviour_ as tabular data. |
#26
| |||
| |||
|
|
phil-news-nospam (AT) ipal (DOT) net wrote: On 01 May 2006 12:41:20 +0100 Chris Morris <c.i.morris (AT) durham (DOT) ac.uk> wrote: | I'm having trouble thinking of a situation where you'd want a | background image of a chessboard (or a background grid in checkerboard | colours with the exact colour crucial) with text and images | superimposed. Could you give a bit more detailed example (with a URL | if you can) of the sort of thing you mean? You want to color in CSS. Be my guest. Show how. But show CSS that can be used with any chess board in tables where only the table element has a class on it. A somewhat artificial restriction but here you go: http://steve.pugh.net/test/chessboard.html Works in Opera and FireFox and IE7, I presume it will work in Safari. As in many situations, IE6 and lower are the problem, not the CSS spec. |
#27
| |||
| |||
|
|
I agree, it's gross. |
|
And anything that doesn't work in ie5/6 is sadly not a viable solution for www. |
|
This is a fairly pathological example in any case. It's more common in my experience to want to colour rows or columns, enabling the classes to be moved out to tr or col, for more concise html. |
#28
| |||
| |||
|
|
On Tue, 2 May 2006, Chris Sharman wrote: I agree, it's gross. Yes, but I found it quite entertaining. I suspect that it's possible to halve the quantity of CSS without having to work too hard, but it's still gross.. |
| http://www.w3.org/TR/CSS21/tables.html#q4 Your column colour can only be effective if the rows *and* the cells specify (or imply) transparent backgrounds. That's fine if all the rows in a given column are to be the same colour; but it's a bit of a non-event if you want to make checkerboard patterns. |
#29
| |||
| |||
|
|
As for halving the amount of CSS. What did you have in mind? I considered setting a default cell colour and the over riding that for particular cells. |
|
But as td+td matches the second and subsequent cells that seemed to be a dead end. |
| http://www.w3.org/TR/CSS21/tables.html#q4 Your column colour can only be effective if the rows *and* the cells specify (or imply) transparent backgrounds. That's fine if all the rows in a given column are to be the same colour; but it's a bit of a non-event if you want to make checkerboard patterns. There's also the fact that background is supported but color is not which means that any colouring done via columns will break the best practice rule of setting colour and background together. |
#30
| |||
| |||
|
|
Is there really any advantage to using DIV elements with float style properies, vs. the old method of TABLE and TR and TD? |
![]() |
| Thread Tools | |
| Display Modes | |
| |