|Title|Generated wikitable class tables include border directive
|Date|10-Mar-2007 16:58:59 EET
|[Bug criticality]|CosmeticBug
|Browser version|Firefox
|[Bug status]|NotABug
|[PageProvider] used|
|Servlet Container|Tomcat
|Operating System|N/A
|URL|any page with a table on it.
|Java version|1.5

The code that generates table markup (there are several, including plugins, and a couple of places in the core wiki code, most notably the markup generator code) includes a border="1" directive in the table markup.  The generated code looks like:

  <table class="wikitable" border="1"> ...

Ideally, there should be no border listed there and all border choices should be done via the wikitable class in the css file.

In conjunction with that, I'd also propose either adding a cellspacing=0 directive to the table markup or making it a preference or parameter or something.  IE lacks the "border-spacing" CSS directive.

I can attach a diff of the changes required to the 2.5 branch, including the related Test files if you'd like.


Nope, not a bug.  Has been discussed to death before.  CSS overrides whatever is defined in the "border" attribute, and this makes it useful on a number of browsers that don't properly interpret CSS.  It does no harm and it improves compatibility.

-- JanneJalkanen


Ok, true enough about the borders, but NOT having the "cellspacing=0", an option for "cellspacing=0" or even an option to set cellspacing to an arbitrary value for Internet Explorer makes styling tables that have single pixel borders impossible.  Internet Explorer doesn't have the border-spacing property, so you can't control the spacing from CSS at all and it defaults to 1.

If you want to see what I mean, create a JSPWiki table and set your wikitable css like this (abbreviated, adjust the th and td accordingly):

   border: 1px solid black;
   border-collapse: collapse;
   border-spacing: 0; /* works for regular browsers, doesn't work for IE 6.0 */

You'll see the little gaps and disjointed borders in IE.

Come to think of it, maybe I should have called the bug "No Cellspacing For Gerated Wikitable Class Tables Is Bad For IE".

--AnonymousCoward, 21-Mar-2007


Yes, you probably should have :-).  Care to open another bug so that we can properly keep track of it?  Copy some of this discussion ot it...

Cellspacing we have to consider, yes.  Though, in all honesty, I don't test code with IE at all anymore.  I know it's the most common browser, but I sleep a lot better if I don't touch it.

--JanneJalkanen, 22-Mar-2007


In Firefox 2, the border="1" seems to prevent me from making a table without borders using CSS. Border lines still appear between columns of the table. Is this maybe a Firefox issue, or am I not using the right CSS to override it?

--AnonymousCoward, 07-Jun-2007