On Oct 8, 1:07 pm, "Andrew Thompson" <u32984@uwe> wrote:
> Jason Cavett wrote:
> >I'm using a JEditorPane to render HTML for the purposes of printing.
> >It works very well except I cannot render borders for tables. I
> >haven't been able to find any bugs in the Sun bug database related to
> >this issue and I'm wondering if I'm just doing something wrong. I've
> >tried using both styles (AKA border-width: 3px
and just <table
> >border=3>.
>
> That HTML is not well-formed. Try this instead:
>
> <html>
> <body>
> <table border='3'>
> <tr>
> <td>R1-C1</td>
> <td>R1-C2</td>
> </tr>
> <tr>
> <td>R2-C1</td>
> <td>R2-C2</td>
> </tr>
> </table>
> </body>
> </html>
>
> >A normal browser ..
>
> What is 'a normal browser'? I am not sure what that
> means 'in your neck o' the woods', but I feel quite
> confident in saying that JEditorPane is no 'normal
> browser - it is no kind of browser at all'. All it is
> good for, is rendering simple, valid (well-formed)
> HTML controlled by you.
>
> >..renders the tables correctly in both cases.
>
> At one time, 50% of the enormous code of IE
> was said to be for correcting crappy HTML. I
> would not be surprised if 20-40%+ of the code of
> other major UAs is much the same. JEP has
> none (or close enough to say as much) of that.
>
> >Thanks for any help/advice you can give.
>
> Validate, validate, validate. Then KISS.
>
> --
> Andrew Thompsonhttp://www.athompson.info/andrew/
>
> Message posted viahttp://www.javakb.com
1. Not sure what HTML you're talking about? I didn't really post any
in my message other than the <table> tag and I wasn't going for well-
formed. I was just showing what I had tried. When I actually write
my application I use well-formed, full HTML (per your example).
2. Normal browser = IE, Firefox, Safari - the three I tested. Yes, I
realize a JEditorPane is not a browser but since I'm only concerned
about rendering HTML, it's all the same thing at the moment.
3. Okay...well...either way IE *does* render the table. JEP does
not. I'm wondering if this is an actual problem or if there is
something I completely missed (which, it doesn't appear I have since
all the other HTML renders correctly).
4. Not sure what you mean by validate. And, the HTML is as simple as
you can get - just one table.