On Mar 21, 4:23 am, btsch...@gmail.com wrote:
> In Java 1.6 on Windows, I'm trying to display an HTML table in a
> JTextPane where cellspacing="0". It should display the cell borders
> as a single line but it is instead displaying it as if cellspacing was
> "1".
Interestingly,
1) cellspacing="20" makes a huge space, so it seems
to be honouring that attribute at some level, in some
form. I suspect that there is some other spacing in
there that the JEditorPane is (in its simplistic styling
of HTML) expecting to see for a true 'no pad' cell.
2) That document is valid HTML 3.2 Transitional!
(Yeah, you probably already knew that, but that is
just the first time anybody that I have seen, has
asked a question about JEP rendering, *and* were using
well-formed HTML - which I thought worthy of note.)
As a piece of general advice: Remove all style
attributes from HTML and put them in an external
stylesheet, so that they can be validated in a CSS
validator. (It looks fine to me, but I am not as
accurate as a software validator.)
If I have any further insights into it, I
will pop back by.
Andrew T.
btschumy@gmail.com - 21 Mar 2007 15:19 GMT
> On Mar 21, 4:23 am, btsch...@gmail.com wrote:
>
[quoted text clipped - 14 lines]
>
> Andrew T.
Andrew,
Yes, the cellspacing attribute is being handled, just not correctly.
I actually tried making it -1 and that does cause single pixel lines
to be drawn between cell, but the the border around all the cells is
still not drawn correctly. I wouldn't want to use this hack in
production code, but it is interesting.