In my , I need to dynamically generate . I know what I need, and I have respective classes for them(base class is MyTable). Their attributes change based on the user’s input.

I have a method to convert the MyTable objects into the , like TableRows, TableLayout, etc.

To put borders between cells, I need to implement complex workarounds, like,

The first cell in a row has padding on all 4 directions, then the following cells have padding only on , right, and bottom.

I have also needed to use ScrollView and HorizontalScrollView since my is bigger than the screen.

My hierarchy goes like,

ScrollView -> HorizontalScrollView -> TableLayout

This code so far, is complex and hard to read at a glance.

And, for one table, I need to implement nested tables, which I haven’t yet done so, but I assume will be complicated to implement.

I have used WebViews, and realized that they handle zooming on their own.

As for changing my current implementations, I can just add a toHTMLString method to my base class, MyTable.

Also, to change border thickness, I can use CSS.

I can easily add multiple new attributes to the tables, with a simple lookup to w3schools,
as opposed to my Android Approach, where I’ll have to search for a suitable workaround
which will definitely be more complex than the CSS approach.

Which approach should I use or should not use ? Is there any particular reason for that?

Source link


Please enter your comment!
Please enter your name here