flutter_widget_from_html icon indicating copy to clipboard operation
flutter_widget_from_html copied to clipboard

Nested Tables?

Open danielgchap opened this issue 2 years ago • 4 comments

Hi there,

I was wondering if this package is able to handle nested tables? I know that this has been challenging for flutter html packages.

Scroll to the bottom here for an example:

https://github.com/Sub6Resources/flutter_html/issues/917

Thank you!

danielgchap avatar May 26 '22 15:05 danielgchap

It should work. You can nest table inside each other, inside list item, etc.

https://try.fwfh.dev/?id=178389000ff93267b1b4b77ee4554855

Screen Shot 2022-05-28 at 21 41 42

daohoangson avatar May 28 '22 14:05 daohoangson

Hey friend,

This does work in regards to having ul and li elements. This is more along the lines of the html that I'm dealing with:

<html> <head></head> <body> <table border="1"> <tr> <td width="25" valign="top">A.</td> <td>This is where the A starts.</td> </tr> <tr> <td width="25" valign="top">B.</td> <td>This is where the B starts.</td> </tr> <tr> <td width="25" valign="top"></td> <td><table width="100%"> <tr> <td width="25" valign="top">(1)</td> <td>This is for number one</td> </tr> <tr> <td width="25" valign="top"></td> <td>This is a whole bunch of text blank</td> </tr> <tr> <td width="25" valign="top">(2)</td> <td>This is for number two</td> </tr> <tr> <td width="25" valign="top"></td> <td>This is another blank text type</td> </tr> </table> </td> </tr> </table> </body> </html>

  • Is there a way for your pub to handle this?
  • Maybe I can inject a ul element to wrap the nested table? Would this work? Suggested approach?

danielgchap avatar Jun 13 '22 07:06 danielgchap

You don't need to wrap it inside an UL, it was just a demo. Your HTML should work as is.

https://try.fwfh.dev/?id=9af7a91a789992c2c64cbb79867990ed

Screen Shot 2022-08-01 at 10 24 14

daohoangson avatar Aug 01 '22 03:08 daohoangson

Hey there, I am still facing an issue where I see large gaps between td elements that are inside of a tr, inside of a table, as such:

Screenshot_1660157158

https://try.fwfh.dev/?id=178389000ff93267b1b4b77ee4554855

Screen Shot 2022-08-10 at 2 54 08 PM

Thoughts?

Thank you!!

danielgchap avatar Aug 10 '22 18:08 danielgchap

The try.fwfh.dev URL shows a different HTML so I couldn't take a closer look. According to the screenshot, the table columns don't specify width so they are equally divided and there were huge space between the texts. New version of this package have had improvements in this area so I'm closing this issue for now. Feel free to create a new one if you are still facing problem with the latest version.

daohoangson avatar Sep 08 '23 14:09 daohoangson