emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Table column width and HTML export
@ 2018-09-18  7:37 Martin Dalgaard Villumsen
  2018-09-18  7:55 ` Eric S Fraga
  2018-09-18 10:31 ` Kaushal Modi
  0 siblings, 2 replies; 8+ messages in thread
From: Martin Dalgaard Villumsen @ 2018-09-18  7:37 UTC (permalink / raw)
  To: Emacs-orgmode@gnu.org

[-- Attachment #1: Type: text/plain, Size: 401 bytes --]

How do I control the column width when exporting a table to HTML?

I know how to control the width of the table, but not the width of its columns. For example, I want the width of column A to be 2 cm and the width of B to be 4 cm:

|  A |  B |
|----+----|
| 11 | 12 |
| 21 | 22 |

Relative settings are also appreciated, A 33% and B 67% of total table width.

Thanks for reading, Martin


[-- Attachment #2: Type: text/html, Size: 3286 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread
* Table column width and HTML export
@ 2018-09-18 11:34 Martin Dalgaard Villumsen
  2018-09-18 18:25 ` Kaushal Modi
  0 siblings, 1 reply; 8+ messages in thread
From: Martin Dalgaard Villumsen @ 2018-09-18 11:34 UTC (permalink / raw)
  To: Emacs-orgmode@gnu.org

[-- Attachment #1: Type: text/plain, Size: 1815 bytes --]

>The org-* classes you mentioned can be easily overridden or used along with > >the new classes, based on how the CSS rules are written.

How do you in org-mode override/identify the column-class for a single column when you have multiple columns of the same type in the same table?

/Martin

From: Kaushal Modi [mailto:kaushal.modi@gmail.com]
Sent: 18. september 2018 13:27
To: Martin Dalgaard Villumsen <mvillumsen@health.sdu.dk>
Cc: Emacs-orgmode@gnu.org
Subject: Re: [O] Table column width and HTML export

Hello,

There seems to be quite a bit of confusion.

On Tue, Sep 18, 2018, 6:51 AM Martin Dalgaard Villumsen <mvillumsen@health.sdu.dk<mailto:mvillumsen@health.sdu.dk>> wrote:
I am not interested in editing the exported HTML file (conflicts the point of using org-mode)
I did not say that HTML should be edited manually. I said that ox-html probably needs an update that inserts the col tag with user-specified col-classes.
 I can add a class to the <table> tag with
#+ATTR_HTML: :class my-table

Correct. That class won't help here. You need a class that scopes the individual columns.
 But I don’t know how to add a new class to <col> in org-mode; or how to define a custom column (one that is now <r>, <l>, <c>).
Right, that needs to be investigated. Most likely, at the moment, we cannot set individual classes for each column.
No point in CSS-restyling default class="org-center", class="org-left", etc.  … this would affect columns in other tables
That's a CSS problem. You can set a unique class for a table using the attr_html syntax you showed above and then set CSS rules only for that table using ".my-table td+td" and so on.

The org-* classes you mentioned can be easily overridden or used along with the new classes, based on how the CSS rules are written.

[-- Attachment #2: Type: text/html, Size: 6710 bytes --]

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

end of thread, other threads:[~2018-09-19 14:25 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-18  7:37 Table column width and HTML export Martin Dalgaard Villumsen
2018-09-18  7:55 ` Eric S Fraga
2018-09-18 10:31 ` Kaushal Modi
2018-09-18 10:51   ` Martin Dalgaard Villumsen
2018-09-18 11:26     ` Kaushal Modi
  -- strict thread matches above, loose matches on Subject: below --
2018-09-18 11:34 Martin Dalgaard Villumsen
2018-09-18 18:25 ` Kaushal Modi
2018-09-19 14:25   ` Martin Dalgaard Villumsen

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).