From: Sebastian Rose <sebastian_rose@gmx.de>
To: mail@christianmoe.com
Cc: Jeff Horn <jrhorn424@gmail.com>,
Dan Davison <dandavison7@gmail.com>,
Bernt Hansen <bernt@norang.ca>,
Org-mode ml <emacs-orgmode@gnu.org>,
Carsten Dominik <carsten.dominik@gmail.com>,
Baoqiu Cui <cbaoqiu@yahoo.com>
Subject: Re: Re: Aligning Columns in HTML Export Tables
Date: Mon, 25 Oct 2010 23:39:33 +0200 [thread overview]
Message-ID: <87lj5mc5pm.fsf@gmx.de> (raw)
In-Reply-To: <4CC5E2E7.300@christianmoe.com> (Christian Moe's message of "Mon, 25 Oct 2010 22:04:55 +0200")
Christian Moe <mail@christianmoe.com> writes:
> Maybe someone with a browser where colgroups actually do work (Opera!) can check
>
> 1. if they only work with the align attribute, and not with CSS, and
>
> 2. whether they still work (take precedence) now that the individual cells are
> aligned with CSS for their class.
They _never_ took precedence, as soon as I used a style like this:
/* My default for all td elements */
td { text-align:left; }
The `td' style will alway be a "better" CSS-match than the col's style
or class attribute, even then the col's align attribute. It's even the
expected behaviour according to CSS standards since that what's the `C'
in CSS means. I have to remove my favourite default style for td
elements from my stylesheet to make that work in Opera, too. In current
FF it does not work at all.
Here's another test:
CSS:
--8<---------------cut here---------------start------------->8---
col.right { text-align:right;vertical-align:top;background-color:red; }
col.left { text-align:left;vertical-align:top;background-color:green; }
col.center { text-align:center;vertical-align:top;background-color:blue; }
--8<---------------cut here---------------end--------------->8---
A table:
--8<---------------cut here---------------start------------->8---
<table border="0" summary="">
<caption></caption>
<colgroup><col class="left" /><col class="center" /><col class="right" />
</colgroup>
<thead>
<tr><th>A</th><th>B</th><th>C</th></tr>
</thead>
<tbody>
<tr><td>1</td><td >bar</td><td>text</td></tr>
<tr><td>12</td><td >test</td><td>300</td></tr>
<tr><td>9</td><td >foo</td><td>4</td></tr>
</tbody>
</table>
--8<---------------cut here---------------end--------------->8---
The only `style' that works that way is the `background-color'. In
Opera and FF at least.
Means, the `class' attribute in <col> elements doesn't work very well
(but '<col class="odd" /><col class="even" />' might make sense with
alternating colors)..
Both, 'align' and the 'style' attribute will be overwritten by a default
style for a <td> element in the users stylesheet (some prefere center,
some left alignment as the default).
It's common practice to have `style' or `class' attribute in td
elements. That's what classes are for in the end. Make HTML elements
members of a group with certain properties.
Why not jut go with it?
Look at `magento's code, Drupal, whatever. They even use more those
usefull classes, e.g. `first' and `last' for the first and last elements
of lists. HTML elements without classes are hard to find. The reason
is, that HTML is just a document structure. Classes (and IDs) make
those elements live.
"first" "last" "right" "left" "content" "footnote" "menu" "comment"
"big" "small" "light" "dark" "pro" "contra" - classes make the
difference.
Plus 'class="right"' is easy to change in central place left
entrirely to the user: the stylesheet.
XML is not meant to avoid clutter. And if it was, something went
terribly wrong, I guess :)
Sebastian
next prev parent reply other threads:[~2010-10-25 21:39 UTC|newest]
Thread overview: 38+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-10-20 16:42 Aligning Columns in HTML Export Tables Jeff Horn
2010-10-20 17:16 ` Bernt Hansen
2010-10-20 19:04 ` Christian Moe
2010-10-20 20:11 ` Jeff Horn
2010-10-21 0:25 ` Sebastian Rose
2010-10-21 7:36 ` Christian Moe
2010-10-21 7:46 ` Carsten Dominik
2010-10-21 13:04 ` Sebastian Rose
2010-10-21 13:25 ` Sebastian Rose
2010-10-22 7:32 ` Carsten Dominik
2010-10-22 11:20 ` Sebastian Rose
2010-10-22 11:27 ` Carsten Dominik
2010-10-22 13:59 ` Sebastian Rose
2010-10-22 15:41 ` Carsten Dominik
2010-10-22 19:30 ` Sebastian Rose
2010-10-23 5:42 ` Carsten Dominik
2010-10-23 19:03 ` Sebastian Rose
2010-10-22 19:37 ` Sebastian Rose
2010-10-23 5:53 ` Carsten Dominik
2010-10-23 19:20 ` Sebastian Rose
2010-10-23 19:28 ` Sebastian Rose
2010-10-25 6:48 ` Carsten Dominik
2010-10-25 9:02 ` Giovanni Ridolfi
2010-10-25 9:09 ` Carsten Dominik
2010-10-25 4:36 ` Baoqiu Cui
2010-10-25 8:51 ` Christian Moe
2010-10-25 9:08 ` Carsten Dominik
2010-10-25 13:13 ` Christian Moe
2010-10-25 13:22 ` Carsten Dominik
2010-10-25 14:55 ` Sebastian Rose
2010-10-25 20:41 ` Christian Moe
2010-10-25 21:52 ` Baoqiu Cui
2010-10-26 5:11 ` Carsten Dominik
2010-10-26 16:03 ` Baoqiu Cui
2010-10-25 13:43 ` Carsten Dominik
2010-10-25 20:04 ` Christian Moe
2010-10-25 21:39 ` Sebastian Rose [this message]
2010-10-26 5:12 ` Carsten Dominik
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87lj5mc5pm.fsf@gmx.de \
--to=sebastian_rose@gmx.de \
--cc=bernt@norang.ca \
--cc=carsten.dominik@gmail.com \
--cc=cbaoqiu@yahoo.com \
--cc=dandavison7@gmail.com \
--cc=emacs-orgmode@gnu.org \
--cc=jrhorn424@gmail.com \
--cc=mail@christianmoe.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.