views:

72

answers:

1

I'm using a JTextPane to display some HTML that contains a table with a border. I want it to have a simple 1 pixel border.

I tried using style="border: 1px solid; border-collapse:collapse". This works in a web browser, but not in JTextPane.

Is there any way to have a simple 1 pixel table border using HTML in a JTextPane?

A: 

javax.swing.text.html is based on HTML 3.2, but you can use the border attribute of the <table> tag.

trashgod
Setting border=1 doesn't create a 1 pixel border, because each cell has it's own border.
Chris B
@Chris B: You may have to adjust `cellspacing` and `cellpadding`, too.
trashgod