java - td background-color does not work with stylesheet in JTextPane -


I'm going to be my first step with the html stylesheet .

I have this style section:

  td.pel {background-color: red; Align: center; Width: 100%} td.d1 {background-color: # D3D3D3; Text-align: center; Vertical-align: medium; } Td.d2 {background color: #BDBDBD; Text-align: center; Vertical-align: medium; } Table.pet {text-align: center; Vertical-align: medium; Font-weight: bold; color white; }  

Yellow and pet are displayed properly d1 and d2 In middle mode and with correct vertical alignment, but does not define by background color . / P>

This is html:

  & lt; Table & gt; & Lt; TR & gt; & Lt; Td square = 'd1' & gt; May & lt; Br / & gt; AB & Lt; / TD & gt; & Lt; Td square = 'd2' & gt; MDHR & lt; Br / & gt; AN & lt; / Td> & Lt; Td square = 'd1' & gt; MDHR & lt; Br / & gt; AB & Lt; / TD & gt; & Lt; Td square = 'd2' & gt; MHSB & lt; Br / & gt; AN & lt; / Td> & Lt; / TR & gt; & Lt; TR & gt; & Lt; Td square = 'yellow' & gt; B1i & lt; / Td> & Lt; Td square = 'yellow' & gt; 33mk & lt; / Td> & Lt; Td square = 'yellow' & gt; 12dsd & lt; / Td> & Lt; Td square = 'yellow' & gt; 4sa & lt; / Td> & Lt; / TR & gt; & Lt; / Table & gt; & Lt; Table class = "pet" & gt; & Lt; TR & gt; & Lt; TD & gt; Feed & lt; / TD & gt; & Lt; / TR & gt; & Lt; / Table & gt;  

This HTML is added to JTextPane so that the result can be displayed in JFrame:

  JTextPane textPane = new JTextPane (); TextPane.setContentType ("text / html"); TextPane.setEditable (wrong); TextPane.setText (lHtml);  

Do you see the problem?


Comments

Popular posts from this blog

java - Can't add JTree to JPanel of a JInternalFrame -

javascript - data.match(var) not working it seems -

javascript - How can I pause a jQuery .each() loop, while waiting for user input? -