emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Alternate Table Row Colors
@ 2009-06-14 19:00 Xin Shi
  2009-06-14 19:11 ` Russell Adams
  2009-06-18  5:09 ` Carsten Dominik
  0 siblings, 2 replies; 6+ messages in thread
From: Xin Shi @ 2009-06-14 19:00 UTC (permalink / raw)
  To: emacs-orgmode


[-- Attachment #1.1: Type: text/plain, Size: 936 bytes --]

Hello Experts,

I use org-mode to produce a lot of big tables with numbers in them. When I
present these tables by HTML, I found it's hard to keep track which row it
is. I'm wondering if it's possible to implement additional class attribute
to the <tr>, such as:


<table class="sample">
<tr class="d0"><td>One</td><td>Fish</td></tr>
<tr class="d1"><td>Two</td><td>Fish</td></tr>
<tr class="d0"><td>Red</td><td>Fish</td></tr>
<tr class="d1"><td>Blue</td><td>Fish</td></tr>
</table>

So, that in the CSS file, it'll be easier to implement the color:

<style type="text/css">
table.sample {
	border: 6px inset #8B8378;
	-moz-border-radius: 6px;
}
table.sample td {
	border: 1px solid black;
	padding: 0.2em 2ex 0.2em 2ex;
	color: black;
}
table.sample tr.d0 td {
	background-color: #FCF6CF;
}
table.sample tr.d1 td {
	background-color: #FEFEF2;
}
</style>

I borrowed idea from this article:
http://www.somacon.com/p338.php

Thanks!

Xin

[-- Attachment #1.2: Type: text/html, Size: 1430 bytes --]

[-- Attachment #2: Type: text/plain, Size: 204 bytes --]

_______________________________________________
Emacs-orgmode mailing list
Remember: use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Alternate Table Row Colors
  2009-06-14 19:00 Alternate Table Row Colors Xin Shi
@ 2009-06-14 19:11 ` Russell Adams
  2009-06-15 12:39   ` Xin Shi
  2009-06-18  5:09 ` Carsten Dominik
  1 sibling, 1 reply; 6+ messages in thread
From: Russell Adams @ 2009-06-14 19:11 UTC (permalink / raw)
  To: emacs-orgmode

Not that I'm a CSS expert, but it appears you could do this without
changing how Org outputs tables by adding this styling to your CSS.

http://www.zorked.com/css/alternating-table-rows-using-css-only/

Quote:

tr:nth-child(odd) {
background-color: #CCCCCC;
}

tr:nth-child(even) {
background-color: #6699FF;
}

Good luck! If you make an example, please post it!

On Sun, Jun 14, 2009 at 03:00:15PM -0400, Xin Shi wrote:
> Hello Experts,
> 
> I use org-mode to produce a lot of big tables with numbers in them. When I
> present these tables by HTML, I found it's hard to keep track which row it
> is. I'm wondering if it's possible to implement additional class attribute
> to the <tr>, such as:
> 
> 
> <table class="sample">
> <tr class="d0"><td>One</td><td>Fish</td></tr>
> <tr class="d1"><td>Two</td><td>Fish</td></tr>
> <tr class="d0"><td>Red</td><td>Fish</td></tr>
> <tr class="d1"><td>Blue</td><td>Fish</td></tr>
> </table>
> 
> So, that in the CSS file, it'll be easier to implement the color:
> 
> <style type="text/css">
> table.sample {
> 	border: 6px inset #8B8378;
> 	-moz-border-radius: 6px;
> }
> table.sample td {
> 	border: 1px solid black;
> 	padding: 0.2em 2ex 0.2em 2ex;
> 	color: black;
> }
> table.sample tr.d0 td {
> 	background-color: #FCF6CF;
> }
> table.sample tr.d1 td {
> 	background-color: #FEFEF2;
> }
> </style>
> 
> I borrowed idea from this article:
> http://www.somacon.com/p338.php
> 
> Thanks!
> 
> Xin

> _______________________________________________
> Emacs-orgmode mailing list
> Remember: use `Reply All' to send replies to the list.
> Emacs-orgmode@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode



------------------------------------------------------------------
Russell Adams                            RLAdams@AdamsInfoServ.com

PGP Key ID:     0x1160DCB3           http://www.adamsinfoserv.com/

Fingerprint:    1723 D8CA 4280 1EC9 557F  66E8 1154 E018 1160 DCB3

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Alternate Table Row Colors
  2009-06-14 19:11 ` Russell Adams
@ 2009-06-15 12:39   ` Xin Shi
  2009-06-15 17:08     ` Xin Shi
  0 siblings, 1 reply; 6+ messages in thread
From: Xin Shi @ 2009-06-15 12:39 UTC (permalink / raw)
  To: emacs-orgmode


[-- Attachment #1.1: Type: text/plain, Size: 2620 bytes --]

Hi Russell,

Thanks for your posting!

Unfortunately, this is quite a new feature for CSS 3, which is not supported
by the Firefox 3.  It would be great if the org-mode can just add the class
attribute in the <tr>.

Xin


On Sun, Jun 14, 2009 at 3:11 PM, Russell Adams <RLAdams@adamsinfoserv.com>wrote:

> Not that I'm a CSS expert, but it appears you could do this without
> changing how Org outputs tables by adding this styling to your CSS.
>
> http://www.zorked.com/css/alternating-table-rows-using-css-only/
>
> Quote:
>
> tr:nth-child(odd) {
> background-color: #CCCCCC;
> }
>
> tr:nth-child(even) {
> background-color: #6699FF;
> }
>
> Good luck! If you make an example, please post it!
>
> On Sun, Jun 14, 2009 at 03:00:15PM -0400, Xin Shi wrote:
> > Hello Experts,
> >
> > I use org-mode to produce a lot of big tables with numbers in them. When
> I
> > present these tables by HTML, I found it's hard to keep track which row
> it
> > is. I'm wondering if it's possible to implement additional class
> attribute
> > to the <tr>, such as:
> >
> >
> > <table class="sample">
> > <tr class="d0"><td>One</td><td>Fish</td></tr>
> > <tr class="d1"><td>Two</td><td>Fish</td></tr>
> > <tr class="d0"><td>Red</td><td>Fish</td></tr>
> > <tr class="d1"><td>Blue</td><td>Fish</td></tr>
> > </table>
> >
> > So, that in the CSS file, it'll be easier to implement the color:
> >
> > <style type="text/css">
> > table.sample {
> >       border: 6px inset #8B8378;
> >       -moz-border-radius: 6px;
> > }
> > table.sample td {
> >       border: 1px solid black;
> >       padding: 0.2em 2ex 0.2em 2ex;
> >       color: black;
> > }
> > table.sample tr.d0 td {
> >       background-color: #FCF6CF;
> > }
> > table.sample tr.d1 td {
> >       background-color: #FEFEF2;
> > }
> > </style>
> >
> > I borrowed idea from this article:
> > http://www.somacon.com/p338.php
> >
> > Thanks!
> >
> > Xin
>
> > _______________________________________________
> > Emacs-orgmode mailing list
> > Remember: use `Reply All' to send replies to the list.
> > Emacs-orgmode@gnu.org
> > http://lists.gnu.org/mailman/listinfo/emacs-orgmode
>
>
>
> ------------------------------------------------------------------
> Russell Adams                            RLAdams@AdamsInfoServ.com
>
> PGP Key ID:     0x1160DCB3           http://www.adamsinfoserv.com/
>
> Fingerprint:    1723 D8CA 4280 1EC9 557F  66E8 1154 E018 1160 DCB3
>
>
> _______________________________________________
> Emacs-orgmode mailing list
> Remember: use `Reply All' to send replies to the list.
> Emacs-orgmode@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode
>

[-- Attachment #1.2: Type: text/html, Size: 4076 bytes --]

[-- Attachment #2: Type: text/plain, Size: 204 bytes --]

_______________________________________________
Emacs-orgmode mailing list
Remember: use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Alternate Table Row Colors
  2009-06-15 12:39   ` Xin Shi
@ 2009-06-15 17:08     ` Xin Shi
  0 siblings, 0 replies; 6+ messages in thread
From: Xin Shi @ 2009-06-15 17:08 UTC (permalink / raw)
  To: emacs-orgmode


[-- Attachment #1.1: Type: text/plain, Size: 3142 bytes --]

Hello Experts,

I took a look in the lisp directory, the related function is in the
org-html.el:

(defun org-format-org-table-html (lines &optional splice)

There it might need a counter for the row in the line
    (push (concat "<tr>"  ...

I don't know how to continue from here ... Any suggestions from our Lisp
experts?

Thanks!

Xin


On Mon, Jun 15, 2009 at 8:39 AM, Xin Shi <shixin111@gmail.com> wrote:

> Hi Russell,
>
> Thanks for your posting!
>
> Unfortunately, this is quite a new feature for CSS 3, which is not
> supported by the Firefox 3.  It would be great if the org-mode can just add
> the class attribute in the <tr>.
>
> Xin
>
>
>
> On Sun, Jun 14, 2009 at 3:11 PM, Russell Adams <RLAdams@adamsinfoserv.com>wrote:
>
>> Not that I'm a CSS expert, but it appears you could do this without
>> changing how Org outputs tables by adding this styling to your CSS.
>>
>> http://www.zorked.com/css/alternating-table-rows-using-css-only/
>>
>> Quote:
>>
>> tr:nth-child(odd) {
>> background-color: #CCCCCC;
>> }
>>
>> tr:nth-child(even) {
>> background-color: #6699FF;
>> }
>>
>> Good luck! If you make an example, please post it!
>>
>> On Sun, Jun 14, 2009 at 03:00:15PM -0400, Xin Shi wrote:
>> > Hello Experts,
>> >
>> > I use org-mode to produce a lot of big tables with numbers in them. When
>> I
>> > present these tables by HTML, I found it's hard to keep track which row
>> it
>> > is. I'm wondering if it's possible to implement additional class
>> attribute
>> > to the <tr>, such as:
>> >
>> >
>> > <table class="sample">
>> > <tr class="d0"><td>One</td><td>Fish</td></tr>
>> > <tr class="d1"><td>Two</td><td>Fish</td></tr>
>> > <tr class="d0"><td>Red</td><td>Fish</td></tr>
>> > <tr class="d1"><td>Blue</td><td>Fish</td></tr>
>> > </table>
>> >
>> > So, that in the CSS file, it'll be easier to implement the color:
>> >
>> > <style type="text/css">
>> > table.sample {
>> >       border: 6px inset #8B8378;
>> >       -moz-border-radius: 6px;
>> > }
>> > table.sample td {
>> >       border: 1px solid black;
>> >       padding: 0.2em 2ex 0.2em 2ex;
>> >       color: black;
>> > }
>> > table.sample tr.d0 td {
>> >       background-color: #FCF6CF;
>> > }
>> > table.sample tr.d1 td {
>> >       background-color: #FEFEF2;
>> > }
>> > </style>
>> >
>> > I borrowed idea from this article:
>> > http://www.somacon.com/p338.php
>> >
>> > Thanks!
>> >
>> > Xin
>>
>> > _______________________________________________
>> > Emacs-orgmode mailing list
>> > Remember: use `Reply All' to send replies to the list.
>> > Emacs-orgmode@gnu.org
>> > http://lists.gnu.org/mailman/listinfo/emacs-orgmode
>>
>>
>>
>> ------------------------------------------------------------------
>> Russell Adams                            RLAdams@AdamsInfoServ.com
>>
>> PGP Key ID:     0x1160DCB3           http://www.adamsinfoserv.com/
>>
>> Fingerprint:    1723 D8CA 4280 1EC9 557F  66E8 1154 E018 1160 DCB3
>>
>>
>> _______________________________________________
>> Emacs-orgmode mailing list
>> Remember: use `Reply All' to send replies to the list.
>> Emacs-orgmode@gnu.org
>> http://lists.gnu.org/mailman/listinfo/emacs-orgmode
>>
>
>

[-- Attachment #1.2: Type: text/html, Size: 4928 bytes --]

[-- Attachment #2: Type: text/plain, Size: 204 bytes --]

_______________________________________________
Emacs-orgmode mailing list
Remember: use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Alternate Table Row Colors
  2009-06-14 19:00 Alternate Table Row Colors Xin Shi
  2009-06-14 19:11 ` Russell Adams
@ 2009-06-18  5:09 ` Carsten Dominik
  2009-06-18 16:21   ` Xin Shi
  1 sibling, 1 reply; 6+ messages in thread
From: Carsten Dominik @ 2009-06-18  5:09 UTC (permalink / raw)
  To: Xin Shi; +Cc: emacs-orgmode

Hi Xin,

I have pushed a change to this effect.  It introduces a new variable
org-export-table-row-tags which can be used for this purpose.

Please the the docstring of that variable.

HTH

- Carsten

On Jun 14, 2009, at 9:00 PM, Xin Shi wrote:

> Hello Experts,
>
> I use org-mode to produce a lot of big tables with numbers in them.  
> When I present these tables by HTML, I found it's hard to keep track  
> which row it is. I'm wondering if it's possible to implement  
> additional class attribute to the <tr>, such as:
>
> <table class="sample">
> <tr class="d0"><td>One</td><td>Fish</td></tr>
> <tr class="d1"><td>Two</td><td>Fish</td></tr>
>
> <tr class="d0"><td>Red</td><td>Fish</td></tr>
> <tr class="d1"><td>Blue</td><td>Fish</td></tr>
> </table>
>
> So, that in the CSS file, it'll be easier to implement the color:
>
>
> <style type="text/css">
> table.sample {
> 	border: 6px inset #8B8378;
> 	-moz-border-radius: 6px;
> }
> table.sample td {
> 	border: 1px solid black;
> 	padding: 0.2em 2ex 0.2em 2ex;
>
> 	color: black;
> }
> table.sample tr.d0 td {
> 	background-color: #FCF6CF;
> }
> table.sample tr.d1 td {
> 	background-color: #FEFEF2;
> }
> </style>
>
> I borrowed idea from this article:
> http://www.somacon.com/p338.php
>
>
> Thanks!
>
> Xin
>
>
> _______________________________________________
> Emacs-orgmode mailing list
> Remember: use `Reply All' to send replies to the list.
> Emacs-orgmode@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Alternate Table Row Colors
  2009-06-18  5:09 ` Carsten Dominik
@ 2009-06-18 16:21   ` Xin Shi
  0 siblings, 0 replies; 6+ messages in thread
From: Xin Shi @ 2009-06-18 16:21 UTC (permalink / raw)
  To: Carsten Dominik; +Cc: emacs-orgmode


[-- Attachment #1.1: Type: text/plain, Size: 1820 bytes --]

Hi Carsten,

That's great! Thanks a lot!

Just one tiny typo in the docstring:

"these ca be Lisp forms"
            ~~~ -> can

Xin

On Thu, Jun 18, 2009 at 1:09 AM, Carsten Dominik
<carsten.dominik@gmail.com>wrote:

> Hi Xin,
>
> I have pushed a change to this effect.  It introduces a new variable
> org-export-table-row-tags which can be used for this purpose.
>
> Please the the docstring of that variable.
>
> HTH
>
> - Carsten
>
>
> On Jun 14, 2009, at 9:00 PM, Xin Shi wrote:
>
>  Hello Experts,
>>
>> I use org-mode to produce a lot of big tables with numbers in them. When I
>> present these tables by HTML, I found it's hard to keep track which row it
>> is. I'm wondering if it's possible to implement additional class attribute
>> to the <tr>, such as:
>>
>> <table class="sample">
>> <tr class="d0"><td>One</td><td>Fish</td></tr>
>> <tr class="d1"><td>Two</td><td>Fish</td></tr>
>>
>> <tr class="d0"><td>Red</td><td>Fish</td></tr>
>> <tr class="d1"><td>Blue</td><td>Fish</td></tr>
>> </table>
>>
>> So, that in the CSS file, it'll be easier to implement the color:
>>
>>
>> <style type="text/css">
>> table.sample {
>>        border: 6px inset #8B8378;
>>        -moz-border-radius: 6px;
>> }
>> table.sample td {
>>        border: 1px solid black;
>>        padding: 0.2em 2ex 0.2em 2ex;
>>
>>        color: black;
>> }
>> table.sample tr.d0 td {
>>        background-color: #FCF6CF;
>> }
>> table.sample tr.d1 td {
>>        background-color: #FEFEF2;
>> }
>> </style>
>>
>> I borrowed idea from this article:
>> http://www.somacon.com/p338.php
>>
>>
>> Thanks!
>>
>> Xin
>>
>>
>> _______________________________________________
>> Emacs-orgmode mailing list
>> Remember: use `Reply All' to send replies to the list.
>> Emacs-orgmode@gnu.org
>> http://lists.gnu.org/mailman/listinfo/emacs-orgmode
>>
>
>

[-- Attachment #1.2: Type: text/html, Size: 3024 bytes --]

[-- Attachment #2: Type: text/plain, Size: 204 bytes --]

_______________________________________________
Emacs-orgmode mailing list
Remember: use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2009-06-18 16:21 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-06-14 19:00 Alternate Table Row Colors Xin Shi
2009-06-14 19:11 ` Russell Adams
2009-06-15 12:39   ` Xin Shi
2009-06-15 17:08     ` Xin Shi
2009-06-18  5:09 ` Carsten Dominik
2009-06-18 16:21   ` Xin Shi

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).