meliorence / react-native-render-html

iOS/Android pure javascript react-native component that renders your HTML into 100% native views
https://meliorence.github.io/react-native-render-html/
BSD 2-Clause "Simplified" License
3.48k stars 589 forks source link

No border showing #551

Closed yash1307raj closed 2 years ago

yash1307raj commented 2 years ago

Decision Table

Good Faith Declaration

Description

<table border="1" cellpadding="1" cellspacing="1" style="width:500px">
    <thead>
        <tr>
            <th scope="col">R1C1</th>
            <th scope="col">R1C2</th>
        </tr>
    </thead>
    <tbody>
        <tr>
            <td>R2C1</td>
            <td>R2C2</td>
        </tr>
        <tr>
            <td>R3C1</td>
            <td>R3C2</td>
        </tr>
    </tbody>
</table>

React Native Information

all are latest

RNRH Version

"^6.3.3",

Tested Platforms

Reproduction Platforms

Minimal, Reproducible Example

Screenshot 2022-02-10 at 12 37 37 PM

Additional Notes

No response

jsamr commented 2 years ago

I think that would be best described as a "support border attribute" feature request! I've added the request here: https://native-html.canny.io/features/p/support-table-border-attribute

kimho commented 2 years ago

I solved the problem using the trick below.

<RenderHtml
   tagsStyles={contentHtmlStyles}
   ...
/>
const contentHtmlStyles = StyleSheet.create({
   table: {
    borderTopWidth:1,
    borderLeftWidth:1,
    borderColor:"#ccc",
    marginBottom: 7
  },
  tr: {
    borderBottomWidth: 1,
    borderColor: "#ccc",
  },
  td: {
    borderRightWidth:1,
    borderColor:"#ccc",
    padding: 5
  },
});