Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

borderwidth not showing in right side and bottom side in Table. #47

Open
Jigs6720 opened this issue Aug 31, 2023 · 2 comments
Open

borderwidth not showing in right side and bottom side in Table. #47

Jigs6720 opened this issue Aug 31, 2023 · 2 comments
Labels
bug Something isn't working

Comments

@Jigs6720
Copy link

Jigs6720 commented Aug 31, 2023

Screenshot_1693480213
in the right side and bottom side border is not showing here is the code.

<RenderHTML
        contentWidth={width}
        source={{
          html: html,
        }}
        renderers={{ table: TableRenderer }}
        WebView={WebView}
        renderersProps={{
          table: {
            computeContainerHeight() {
              return null;
            },
            webViewProps: {
              style: {
                backgroundColor: "transparent",
                marginVertical: 10,
                alignItems: "center",
                borderWidth: 1,
                borderColor: "lightgray",
              },
              nestedScrollEnabled: true,
              scalesPageToFit: true,
              bounces: false,
            },
          },
          a: {
            onPress(event, url, htmlAttribs, target) {
              // Do stuff
              if (url) {
                openLink(url, colors.text, colors.background);
              }
            },
          },
        }}
        customHTMLElementModels={{
          table: tableModel
        }}
        systemFonts={[
          Typography.MuseoSansRegularText,
          Typography.MuseoSansBoldText,
        ]}
        enableCSSInlineProcessing={enableCSSInlineProcessing}
        baseStyle={contentHeight && { minHeight: contentHeight }}
        tagsStyles={{
          body: {
            // width: "96%",
            paddingHorizontal: 10,
            fontWeight: "400",
            fontFamily: Typography.MuseoSansRegularText,
            lineHeight: 24,
            alignSelf: "center",
            fontSize: 16,
            color: colors.text,
            ...bodyStyle,
          },
          p: {
            fontWeight: "400",
            fontFamily: Typography.MuseoSansRegularText,
            lineHeight: 24,
            fontSize: 16,
            color: colors.text,
            marginVertical: 0,
            ...paragraphStyle,
          },
          span: {
            fontWeight: "400",
            fontFamily: Typography.MuseoSansRegularText,
            lineHeight: 24,
            fontSize: 16,
            color: colors.text,
          },
          div: {
            fontWeight: "400",
            fontFamily: Typography.MuseoSansRegularText,
            lineHeight: 24,
            fontSize: 16,
            color: colors.text,
          },
          img: {
            width: imgWidth || "100%",
            resizeMode: "contain",
            alignItems: "center",
          },
          table: commonStyles.table(colors),
          tbody: commonStyles.tbody(colors),
          td: commonStyles.td(colors),
          tr: commonStyles.tr(colors),
          th: commonStyles.th(colors),
          thead: commonStyles.thead(colors),
          tbody: commonStyles.tbody(colors),
        }}
      />
@Jigs6720 Jigs6720 added the bug Something isn't working label Aug 31, 2023
@Ajololr
Copy link

Ajololr commented Oct 9, 2023

We are experiencing the same issue. For some reason setting outerBorderWidthPx to -1 fixed the problem in our case. But it is not an expected behaviour

import {
  cssRulesFromSpecs,
  defaultTableStylesSpecs,
} from '@native-html/table-plugin';

... 

<RenderHTML
      ...
      renderersProps={{
        table: {
          cssRules: cssRulesFromSpecs({
            ...defaultTableStylesSpecs,
            outerBorderWidthPx: -1,
          }),
        },
      }}
    />

@DeepakSharma04
Copy link

Hi @Ajololr how i can remove width in the table style.

<table cellspacing="0" cellpadding="0" border="1" style="font-size:10pt; font-family:Arial;width:0px; border-collapse:collapse; border:none;">

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants