react-native-htmlview icon indicating copy to clipboard operation
react-native-htmlview copied to clipboard

Does anyone have a solution on how to manage inline style?

Open Richi2293 opened this issue 7 years ago • 5 comments

Hi,

I have to be able to manage a html like this:

<table style="background-color: #72be58; height: 92px;" width="202">
<tbody>
<tr>
<td style="width: 192px;">
<p><img style="display: block; margin-left: auto; margin-right: auto;" src="https:/image.com" alt="" width="185" height="42" /></p>
<p>&nbsp; <span style="color: #ffffff;"><strong>Powered by MySite</strong></span></p>
</td>
</tr>
</tbody>
</table>

Has anyone found an effective way? Thanks

Richi2293 avatar Jun 09 '18 11:06 Richi2293

Same issue, any idea?

peterng014 avatar Dec 08 '18 09:12 peterng014

same here ...

lewatt23 avatar Aug 01 '19 01:08 lewatt23

@Richi2293 found a solution ?

lewatt23 avatar Aug 01 '19 20:08 lewatt23

Hi, I don't remember having found a real solution, maybe a possible solution is to use a webview component and load local html

Richi2293 avatar Aug 01 '19 22:08 Richi2293

You sould define renderNode and get node.attribs.style string and split and trim this string for geting key value pair and with a module that i cant remember now, convert css key to rn style key and make a object with key value as styles object. This solution for geting key value from string, needs loop that can be expensive for big inline css styles

h2soheili avatar Oct 01 '19 21:10 h2soheili