From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nick Dokos Subject: Re: how to specify table width in HTML export Date: Tue, 20 Mar 2012 10:42:48 -0400 Message-ID: <26581.1332254568@alphaville> References: <24029.1332226407@alphaville> <1332227798.16454.YahooMailNeo@web161905.mail.bf1.yahoo.com> Reply-To: nicholas.dokos@hp.com Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([208.118.235.92]:58011) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SA0H4-00067Q-Ov for emacs-orgmode@gnu.org; Tue, 20 Mar 2012 10:43:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SA0Gy-0001tJ-5q for emacs-orgmode@gnu.org; Tue, 20 Mar 2012 10:42:58 -0400 Received: from g5t0009.atlanta.hp.com ([15.192.0.46]:19688) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SA0Gy-0001t7-0Q for emacs-orgmode@gnu.org; Tue, 20 Mar 2012 10:42:52 -0400 In-Reply-To: Message from Michael Hannon of "Tue\, 20 Mar 2012 00\:16\:38 PDT." <1332227798.16454.YahooMailNeo@web161905.mail.bf1.yahoo.com> 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-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Michael Hannon Cc: "Stephen J. Barr" , nicholas.dokos@hp.com, "emacs-orgmode@gnu.org" Michael Hannon wrote: > > From: Nick Dokos > > > > Stephen J. Barr wrote: > > > >> Hello, > >> > >> This seems like a simple question but I can't seem to find the answer? > >> How do I specify the table width for an org-table that I will export > >> to HTML? > >> > > > > Not sure about the real HTMl syntax, or whether this is the best > > solution (I'd imagine CSS would be better *if* it can be done with CSS) > > but the following: > > > > #+ATTR_HTML: width=3D"100" > > | col1 | col2 | > > |------+------| > > |=C2=A0=C2=A0=C2=A0 1 |=C2=A0=C2=A0=C2=A0 3 | > > |=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 |=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 | > > > > gets translated into an HTML table with an opening tag like this: > > > > > cellpadding=3D"6" rules=3D"groups" frame=3D"hsides" > > width=3D"100"> > > > > Does that do the trick? >=20 > Indeed, I think CSS would be a better approach.=C2=A0 And of course I don= 't know > what this particular application is, but it's usually better to specify t= he > width of objects as a percentage of the overall width. >=20 Just to make sure #+ATTR_HTML: width=3D"50%" is just the "same" as far as the HTML exporter is concerned: it'll just bli= ndly tack it to the tag. > This is discussed, for instance, at: >=20 > =C2=A0=C2=A0=C2=A0 http://www.w3schools.com/css/css_table.asp >=20 Nice reference, thanks! Particularly for those (like me) whose CSS fu is weak to non-existent. > Here's a line from one of my old .org files that shows the syntax: >=20 > =C2=A0=C2=A0=C2=A0 #+STYLE:=C2=A0=C2=A0=C2=A0 >=20 > It's also possible to embed the styling information directly in the Org-m= ode > file, but I find that to be less convenient, as you then have to re-expor= t to > make a change to the style. >=20 > Caveat: I haven't done any HTML exporting to speak of lately, certainly n= one > that has involved CSS, so it may be that the syntax has changed (i.e., > compared to the above STYLE directive). >=20 I think things have not changed in this area. Nick