From: Felix W. <Fel...@gm...> - 2004-10-16 15:24:03
|
Remco Boerma wrote: > i've created a table in reST and parse it to HTML. now i want some of > the cell's to be right alligned, instead of being left aligned. > > I cannot find a way to do settings some sort of properties of > HTML,CSS, or something else. First of all, sorry for the slow response time; I've been away for some time. Concerning your problem, I found the following solution: 1. Copy tools/stylesheets/default.css to a new file, e.g. new_stylesheet.css. 2. Add the following text at the end of new_stylesheet.css:: .flushright { text-align: right; } 3. Make the paragraphs in the cells right-aligned by using the flushright class. You need to prepend *every* paragraph to be right-aligned with the class directive:: +---------------------+---------------------+ |A paragraph of some |.. class:: flushright| |normal text. | | | |Right-aligned. | | | | | |.. class:: flushright| | | | | |Another paragraph. | +---------------------+---------------------+ 4. Process the file with Docutils, using the new stylesheet file as stylesheet:: rst2html.py --stylesheet-path=new_stylesheet.css cell_align.txt cell_align.html However, this will not work with Docutils 0.3.5. In trying to find this solution I discovered a bug which is only fixed in the most current CVS sources. You can download a snapshot from <http://docutils.sourceforge.net/docutils-snapshot.tgz>. This solution is admittedly not very elegant. I'm Cc'ing to Doc...@li... -- maybe someone knows a better way to align table cells. There has been a thread about adding classes for table rows and columns, which would allow easier customization via CSS. See <http://thread.gmane.org/gmane.text.docutils.devel/1825>. -- Felix Wiemann -- http://www.ososo.de/ |