Win a copy of Java Concurrency Live Lessons this week in the Threads forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

HTML  RSS feed

 
Richard West
Ranch Hand
Posts: 127
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi everyone,

I am trying to add html tables to a html document and the html table appears but here is the problem in that only certain attributes of the table is being adhered to and the rest ignored. This is what i am doing



Please note that Pane1 is an instance of the JTextPane class and doc is an instance of the HTMLDocument class which uses the default HTMLEditorKit class.

The table appears in the document but only cell padding, background color and table width options if varied produces the appropriate changes to the table that is being inserted.

The rest of the options such as borderwidth, bordercolor cell spacing and table height don't have any differences even when they are varied. They always remain the same.

Basically i need to know if i am inserting the html table correctly into the HTMLDocument or is there something that i need to do which i am not doing in the above code.

I am using the java sdk 1.4.2

Any help is greatly appreciated

Thank You

Yours Sincerely

Richard West
 
Mike Rainville
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You should verify that any HTML features you use are included in HTML version 3.2 aka Wilbur.
The Java JEditorPane is limited to that, for the moment.

from API documentation

" ...HTML text. The kit used in this case is the class javax.swing.text.html.HTMLEditorKit which provides HTML 3.2 support." (Same for 1.4.2 and 1.5)

for alternatives, try here: http://today.java.net/pub/a/today/2004/05/24/html-pt1.html

Good luck,
Mike
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!