[FREE] TableViewer - fully style customized to show table data

I have make another version of TableViewer, it's a package of Webviewer and Javascript and CSS.
so you can set up the style as you wish, if you know some CSS knowledge.

Alll Blocks

Init the extension

image-20221005142959876
layout can be vertical arrangement or horizontal arrangement.
No need for scroll arrangement, since this extension can handle the scrolling.

SetData

image-20221005143010573
data should be a LIST OF LIST.

SetStyle

image-20221005143023860

SetStyleSheet

image-20221010185548477
now the sheet socket can accept:

  1. style sheet like 'th{background-color:lightblue; position:sticky; top:0}'
  2. online css file path like 'http://your.domain.com/cssfile.css'
  3. local css file, like '//cssfile.css' (for from assets) or 'cssfile.css' (for from ASD)

SetClass

image
className should come from the sheet in the SetStyleSheet method.

SetJavaScript

image
Add javaScript to header of the HTML.
No take effect before call ShowTable

ClearStyle

image

ShowTable

image-20221010185604046

ScrollTo

image
smooth: true or false

RunJs

image
Take effect immediately. No need to call ShowTable again.

SetStyleWithJs

image
Take effect immediately. No need to call ShowTable again.

image-20221010190719285
image-20221010190705454
image-20221010190101719

image

image

image
image
image

Sample blocks

1. basic usage:

image-20221010191516407
image-20221010191531671

2. fix first row on top.


Some useful SetStyle:

set outer margin of table
Snipaste_2022-10-08_18-57-55

set background-color of 2nd row:
Snipaste_2022-10-08_18-58-04

set font-size of all odd column:
Snipaste_2022-10-08_18-58-10

set border-width of cell at row 3 column 3:
Snipaste_2022-10-08_18-58-17

Download

for more information please check here:

Useful tutorials in this thread:

Most of them from @TIMAI2 . Big thanks to him.

filter the data with textbox :
过滤数据

fix the header, and make the header with border:
固定表头,并让表头有边框

fix the left column:
固定左边1列

change the order of column:
更换列的顺序

set the table to match to the width of the data:

show a table with image from base64:

show table in cardview styling:

show table as spinner looklike:

24 Likes

Built-in properties not displaying ?

image

You show an html file, how is this used with the extension? (or does this simply show the html generated from the data?)

1 Like

Sorry, I forget to mention the value of the property should be same as in CSS:
image

the html picture is only to show the structure of the html behind the table, then you will know how to write the style/css to change table/tr/td etc.

3 Likes

Works fine, thanks

Worked up a solution for this:

https://community.appinventor.mit.edu/t/how-can-put-color-in-tableview-if-word-yes/67188/6

image

Do you know of a better approach ?

3 Likes

[Feature Request]
With your table click function, it would be good to return the entire row text for all columns as well.

I only know this method.

for entire row data, you may use the "select list item" to pick data from original data list.

and i am considering to add a block to combine nearby cells, which will make this entire row data very complicated.

1 Like

Another example which "answers" this question:

image

so much easier :smiley:

2 Likes

I'm trying to show a csv with many columns, how can I set horizontal scroll ?
blocks(1)

Just drag left/right, should be scrollable vert/horiz automatically

[Feature request]
Sticky header row

found this:

but requires a th row.

Tried with tr:nth-child(1) but nothing happened

1 Like

Some blocks for table styling (there are 8columns, 5 to scroll to....

image

3 Likes

Thank you Tim, solved with

1 Like

With these blocks I can set the selected cell background color, how can I restore the previous color after selecting another cell? I can save row and col but the color ?

would the original colour be known, e.g. the one you set when drawing the table ?

v2 is coming, pls check first post.

now is possible. it looks like th is not necessary, but thead is.
I have add a sample at 1st post.

now it's possible to remove the style you already setup last time, just to set the value to "" (empty string) using SetStyle block, then ShowTable.

2 Likes

i can't show my table in the table viewer


@KhuBann

now "Index: 7, Size: 7
Note: You will not see another error reported for 5 seconds."