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

Table parsing error. If merging cells in HTML5 is not supported, no error should be reported #213

Closed
luyi-word opened this issue Jan 13, 2020 · 8 comments

Comments

@luyi-word
Copy link

image
image

This kind of problem hopes to be solved as soon as possible
这种问题希望尽快解决 .

@Sub6Resources
Copy link
Owner

Thank you for reporting this. Would you mind posting your HTML code so that I can better support merged cells?

@luyi-word
Copy link
Author

一、接收调剂考生的学科

培养单位名称

学科代码名称

咨询电话

报名时间

(003)法学院

(030102)法律史

张老师0551-63861289

4月2日上午10:00至4月3日上午10:00

(003)法学院

(030103)宪法学与行政法学

张老师0551-63861289

@luyi-word
Copy link
Author

style: {

              "table": Style(
                border:  Border.all(width: 1, color: Color(0xff7FA6F3)),
                width: 750,
                fontFamily: 'serif',
              ),
              "th":Style(
                border:  Border.all(width: 1, color: Color(0xff7FA6F3)),
                // width: 750,
                fontFamily: 'serif',
              ),
              "td":Style(
                border:  Border.all(width: 1, color: Color(0xff7FA6F3)),
                // width: 750,
                fontFamily: 'serif',
              ),
              "tr":Style(
                border:  Border.all(width: 1, color: Color(0xff7FA6F3)),
                // width: 750,
                fontFamily: 'serif',
              ),
              },

///==================
image

Can adding line styles to tables be optimized

@canisterism
Copy link

I added +1 because I think I'm encountering (probably) the same problem.

I have HTML like below:

<table>
  <colgroup>
    <col width="30%"/>
    <col width="70%"/>
  </colgroup>
  <tr>
    <th>AAAAAAAAAAAAAAAAAAAAAAAAAAAA</th>
    <td>B</td>
  </tr>
  <tr>
    <th>A</th>
    <td>BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB</td>
  </tr>
</table>

And my styles are like this:

final Map<String, Style> htmlStyles = {
  'table': Style(
    backgroundColor: MyColors.backGroundColor,
    border: Border.all(color: MyColors.surfaceOverlay),
  ),
  'th': Style(
    display: Display.INLINE,
    alignment: Alignment.center,
    backgroundColor: MyColors.lightGrey,
    padding: const EdgeInsets.all(8),
  ),
  'td': Style(
    display: Display.INLINE,
    backgroundColor: MyColors.backGroundColor,
    padding: const EdgeInsets.all(8),
  ),
};

Then the screen would be:
image

But I expected the left-bottom cell (having 'A') to expand to the table's bottom line. Its height is just the same as its text-height.

@erickok
Copy link
Collaborator

erickok commented Jun 17, 2020

@canisterism your issue is unrelated in the sense that you do not have cells spanning multiple rows or columns. Instead your issue arrises simply because the abckground is set on the text style and not on the whole table cell.

@canisterism
Copy link

@erickok
Ooops, thank you, you're right. I'll raise another issue.

@erickok
Copy link
Collaborator

erickok commented Aug 6, 2020

Thing is, flutter_html uses Flutter's own Table widget and that doesn't support colspan-like irregular cells (flutter/flutter:21594). The staggered_grid package is one alternative we might consider.

@erickok
Copy link
Collaborator

erickok commented Nov 2, 2020

Duplicate of #242

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants