emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Martin Dalgaard Villumsen <mvillumsen@health.sdu.dk>
To: Kaushal Modi <kaushal.modi@gmail.com>
Cc: "Emacs-orgmode@gnu.org" <Emacs-orgmode@gnu.org>
Subject: Re: Table column width and HTML export
Date: Tue, 18 Sep 2018 10:51:30 +0000	[thread overview]
Message-ID: <0460bf4c386942e790d32260cbf0ae7c@health.sdu.dk> (raw)
In-Reply-To: <CAFyQvY00Dm4sCsDGmNdvQJYoPmZ2SV4WVZjLYDnE4VhFv=K77w@mail.gmail.com>

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

I am not interested in editing the exported HTML file (conflicts the point of using org-mode)

I can add a class to the <table> tag with

#+ATTR_HTML: :class my-table

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

No point in CSS-restyling default class="org-center", class="org-left", etc.  … this would affect columns in other tables


/Martin

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

On Tue, Sep 18, 2018, 3:38 AM Martin Dalgaard Villumsen <mvillumsen@health.sdu.dk<mailto:mvillumsen@health.sdu.dk>> wrote:
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.
Hello,

This needs to be solved using CSS. See an example here: https://stackoverflow.com/questions/6253963/table-with-table-layout-fixed-and-how-to-make-one-column-wider

In that two solutions are suggested in the selected answer. You should be able to implement the first way using the "td+td" CSS rule.

For the second way using the "col" tag, I don't have the computer accessible right now, to check if ox-html can insert that tag. Even if it did add that tag, you would need to specify the class string for each column, and then use CSS to set the width of each column class.

Right now, the first method seems to be the best?/fastest/easiest way forward.

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

  reply	other threads:[~2018-09-18 10:51 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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

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

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=0460bf4c386942e790d32260cbf0ae7c@health.sdu.dk \
    --to=mvillumsen@health.sdu.dk \
    --cc=Emacs-orgmode@gnu.org \
    --cc=kaushal.modi@gmail.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 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).