Description

The borders of tables are generated by the style sheet only.

I have to transfer wiki pages to open office documents. I use "cut'n'paste" of the print view. As this seems to ignore the style sheet settings the tables have no border in open office.

It is arguable if this is a bug in wiki. A not-really-knowing-what-I-do fix for this is, to patch formatter/txt_html.py (it's is against an old version (1.5.X) and has to be adjusted for newer versions)

Index: formatter/text_html.py
===================================================================
RCS file: /cvs/TPS/moin/MoinMoin/formatter/text_html.py,v
retrieving revision 1.1.1.4
diff -u -r1.1.1.4 text_html.py
--- formatter/text_html.py      10 Dec 2006 11:46:45 -0000      1.1.1.4
+++ formatter/text_html.py      14 Jan 2009 14:00:47 -0000
@@ -1229,7 +1285,8 @@
     # Tables #############################################################
 
     _allowed_table_attrs = {
-        'table': ['class', 'id', 'style'],
+        # enable border on cut'n'paste
+        'table': ['class', 'id', 'style', 'border', 'cellspacing'],
         'row': ['class', 'id', 'style'],
         '': ['colspan', 'rowspan', 'class', 'id', 'style'],
     }
@@ -1301,7 +1358,8 @@
 
             # Open table
             if not attrs:
-                attrs = {}
+                # enable border on cut'n'paste
+                attrs = {'border':'1','cellspacing':'0'}
             else:
                 attrs = self._checkTableAttr(attrs, 'table')
             result.append(self._open('table', newline=1, attr=attrs,

Steps to reproduce

  1. Choose a page with a table.
  2. Look at the print view. The table will have a border.
  3. Cut'n'paste into open office.
  4. Look at print view in open office. The table will have no border.

Example

Component selection

Details

MoinMoin Version

1.8.x (this Wiki)

OS and Version

Python Version

Server Setup

Server Details

Language you are using the wiki in (set in the browser/UserPreferences)

Workaround

Discussion

Plan


CategoryMoinMoinBug

MoinMoin: MoinMoinBugs/TableHaveNoBorderWhenCopyiedToOtherApplications (last edited 2009-01-15 13:42:25 by MarcelHäfner)