flutter_widget_from_html icon indicating copy to clipboard operation
flutter_widget_from_html copied to clipboard

Horizontal alignment in table cell 'text-align' is not working.

Open Louis115 opened this issue 1 year ago • 7 comments

I want to center content in a

horizontally, but just found the package does not support the horizontal alignment in table elements. Can we add that new feature? Or is there any workaround? Or which scripts should I look in to?

Louis115 avatar Aug 22 '24 09:08 Louis115

What is your HTML?

daohoangson avatar Sep 29 '24 11:09 daohoangson

table1 table2

 'border': '1px solid #000',
      // 'text-align': 'center',
      'padding': '2px 5px',
      'outline': '0',
      'width': '100px',

I want to center content in a table cell horizontally, but the 'text-align': 'center' seems not supported

Louis115 avatar Oct 01 '24 22:10 Louis115

Same Issue...

affan3699 avatar Apr 08 '25 12:04 affan3699

@daohoangson please fix this issue

rockingdice avatar Apr 17 '25 02:04 rockingdice

I found my way to solve the issue by using the factoryBuilder to redefine the whole Flutter widget return from the HTML table. You can override the widgets returned by the table tags and their content to Container and Text widgets, and map their style with the CSS

Louis115 avatar Apr 17 '25 06:04 Louis115

I found my way to solve the issue by using the factoryBuilder to redefine the whole Flutter widget return from the HTML table. You can override the widgets returned by the table tags and their content to Container and Text widgets, and map their style with the CSS

can you share your codes? thanks.

rockingdice avatar Apr 18 '25 04:04 rockingdice

[email protected] has been released with the fix for this. Please upgrade and let me know whether it works for you.

daohoangson avatar Jul 15 '25 04:07 daohoangson