From mboxrd@z Thu Jan 1 00:00:00 1970 From: Kaushal Modi Subject: Re: Table column width and HTML export Date: Tue, 18 Sep 2018 06:31:18 -0400 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="0000000000001c7b1a057622cb80" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:33119) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g2DIC-00052x-6z for Emacs-orgmode@gnu.org; Tue, 18 Sep 2018 06:31:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g2DI6-0007m0-Ma for Emacs-orgmode@gnu.org; Tue, 18 Sep 2018 06:31:36 -0400 Received: from mail-lj1-x22d.google.com ([2a00:1450:4864:20::22d]:38227) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1g2DI6-0007iU-1Z for Emacs-orgmode@gnu.org; Tue, 18 Sep 2018 06:31:34 -0400 Received: by mail-lj1-x22d.google.com with SMTP id p6-v6so1278745ljc.5 for ; Tue, 18 Sep 2018 03:31:33 -0700 (PDT) In-Reply-To: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: Martin Dalgaard Villumsen Cc: Emacs-orgmode@gnu.org --0000000000001c7b1a057622cb80 Content-Type: text/plain; charset="UTF-8" On Tue, Sep 18, 2018, 3:38 AM Martin Dalgaard Villumsen < 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. > --0000000000001c7b1a057622cb80 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On T= ue, Sep 18, 2018, 3:38 AM Martin Dalgaard Villumsen <mvillumsen@health.sdu.dk> wrote:
<= div class=3D"gmail_quote" dir=3D"auto">

How do I control the column wid= th when exporting a table to HTML?

=C2=A0

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

=C2=A0

|=C2=A0 A |=C2=A0 B |

|----+----|

| 11 | 12 |

| 21 | 22 |

=C2=A0

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

Hello,

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

In that two solutio= ns are suggested in the selected answer. You should be able to implement th= e first way using the "td+td" CSS rule.=C2=A0

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

Right now, the first method seems to be the best?/fastest/easiest way for= ward.=C2=A0
--0000000000001c7b1a057622cb80--