{"id":13989162,"url":"https://github.com/huangyanbin/smartTable","last_synced_at":"2025-07-22T10:31:32.640Z","repository":{"id":37392689,"uuid":"109910389","full_name":"huangyanbin/smartTable","owner":"huangyanbin","description":"一款android自动生成表格框架---An Android automatically generated table framework","archived":false,"fork":false,"pushed_at":"2022-03-11T09:08:26.000Z","size":63951,"stargazers_count":5198,"open_issues_count":203,"forks_count":869,"subscribers_count":107,"default_branch":"master","last_synced_at":"2025-05-28T21:50:56.844Z","etag":null,"topics":["android","android-library","android-table","android-view","annotation","table","table-lib","table-library"],"latest_commit_sha":null,"homepage":"https://juejin.im/post/5a5dce7651882573256bd043","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/huangyanbin.png","metadata":{"files":{"readme":"README.en.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-11-08T01:11:14.000Z","updated_at":"2025-05-23T00:54:46.000Z","dependencies_parsed_at":"2022-08-03T09:45:21.134Z","dependency_job_id":null,"html_url":"https://github.com/huangyanbin/smartTable","commit_stats":null,"previous_names":[],"tags_count":44,"template":false,"template_full_name":null,"purl":"pkg:github/huangyanbin/smartTable","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/huangyanbin%2FsmartTable","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/huangyanbin%2FsmartTable/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/huangyanbin%2FsmartTable/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/huangyanbin%2FsmartTable/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/huangyanbin","download_url":"https://codeload.github.com/huangyanbin/smartTable/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/huangyanbin%2FsmartTable/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266475108,"owners_count":23934882,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-22T02:00:09.085Z","response_time":66,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["android","android-library","android-table","android-view","annotation","table","table-lib","table-library"],"created_at":"2024-08-09T13:01:32.621Z","updated_at":"2025-07-22T10:31:27.612Z","avatar_url":"https://github.com/huangyanbin.png","language":"Java","readme":"# SmartTable\n[![](https://jitpack.io/v/huangyanbin/smartTable.svg)](https://jitpack.io/#huangyanbin/smartTable)\n###### An Andr oid automatically generated table framework\n* [Chinese README](/README.md/)\n* [Apk download version1.7](/img/smartTable.apk)\n* [Version of history](/README_old_version_en.md/)\n\u003e function introduction\n1. fast configuration automatic generation of tables;\n2. automatic calculation table width;\n3. table column header combination;\n4. the table holds the left sequence, the top sequence, the first row, the column heading, and the statistics row;\n5. automatic statistics, sort (also can customize the statistical rules);\n6. format graphic, serial number, column title formatting;\n7. configuration, background, text, grid, padding and so on;\n8. form notation;\n9. table content, column title click event;\n10. zoom mode and scroll mode;\n11. annotation mode;\n12. contents are displayed in many lines.\n13. pagination mode;\n14. dynamically added data at the end of the end.\n15. rich formatting;\n16. support two dimensional array display (for similar timetable, film ballot, etc.)\n17. import excel (support color, font, background, annotation, alignment, picture and other basic Excel attributes)\n18. form merge unit (supporting annotating merge, supporting auto merge)\n19. support the other refresh framework SmartRefreshLayout\n20. the minimum width of a configurable table (less than the width of this width)\n21. support direct List or array field columns\n22. JSON data direct conversion table\n\u003e Basic function display\n\n![Basic](/img/table.gif)\n\n\u003e Zoom function\n\n![Zoom](/img/zoom.gif)\n\n\u003e refresh function(Use SmartRefreshLayout)\n\n![refresh](/img/refresh.gif)\n\n\u003e Import Excel (using Jxl jar)\n\n![Excel](/img/old_excel.png)\n![Excel](/img/new_excel.png)\n\n\u003e Importing a two-dimensional array\n\n![schedule](/img/progress.jpg)\n![Vote](/img/seat.jpg)\n\n\u003e List or array column\n\n![课表表](/img/arrayColumn.gif)\n\u003e How Use\n\n- Quote\n\n\u003e *  Step 1. Add the JitPack repository to your build file\n\n```gradle\nallprojects {\n\t\trepositories {\n\t\t\t...\n\t\t\tmaven { url 'https://www.jitpack.io' }\n\t\t}\n\t}\n```\n\n\u003e * 2. Add the dependency\n\n```gradle\ndependencies {\n\t        compile 'com.github.huangyanbin:SmartTable:1.8.3'\n\t}\n```\n\n\u003e * Use SmartTable\n\n```\n \u003ccom.bin.david.form.core.SmartTable\n       android:id=\"@+id/table\"\n       android:layout_width=\"match_parent\"\n       android:layout_height=\"match_parent\"\n      /\u003e\n ```\n\n**- Annotation mode**\n\n\u003e *  Add annotations to the class that you need to generate\n\n```\n@SmartTable(name=\"table name\")\n```\n\n\u003e *  Add notes to fields you need to display\n\n```\n// ID sorts the table for the table in which the field is located\n @SmartColumn(id =1,name = \"ColumnName\")\n```\n\u003e * Setting table data\n\n```\n        table = findViewById(R.id.table);\n        table.setData(list);\n```\n\n\u003e The annotation pattern is so simple that you can run directly to see the effect. Of course, this is just the basic configuration of annotations. There are also automatic statistics, column combinations, and so on. If you want to know more about the annotation, please check the demo.\n\nTable ```@SmartTable``` ###### notes, used to generate the table.\n\nHeader 1 header 2 |\n---|---\nName | table name\nCount is | statistics for\nPageSize | page number\nCurrentPage | the current page\n\n###### ```@SmartColumn``` column for comment column.\n\nNote | effect\n---|---\nName | column headings\nID | position (column sorting is smaller at the front)\nParent | parent column name (not set no parent column)\nAlign | column alignment\nType | query set whether the next level\nAutoMerge | is set to automatically merge\nWith the maximum number of maxMergeCount |\nAutoCount | is on statistics\nWhether the column fixed | fixed\n\n\n\u003e explanation:\n\n- align\n\n\u003e set the column alignment, default Center\n\n- type\n\n\u003e ColumnType.Own, ColumnType.Child two, a value can be set, assuming that UserInfo has an attribute Family family object, you want to attribute monther parsing faily object, father two properties, you need to set the Child, and in monther, add the corresponding notes @ SmartColumn father, otherwise only resolved to Family, the default is Own.\n\n- autoMerge\n\nIf the data that you return is formatted, the same data near the column will be automatically merged into a cell that does not open the merge by default.\n\n- autoCount\n\n\u003e table opens the display statistics line and sets the autoCount to true, then the column can be automatically counted, and the default is false.\n\n- Fixed\n\n\u003e fixed is set to true, which can be automatically fixed when the column rolls to the left.\n**- Basic mode**\n```\n    //Common column\n   Column\u003cString\u003e column1 = new Column\u003c\u003e(\"name\", \"name\");\n   Column\u003cInteger\u003e column2 = new Column\u003c\u003e(\"age\", \"age\");\n   Column\u003cLong\u003e column3 = new Column\u003c\u003e(\"time\", \"time\");\n    Column\u003cString\u003e column4 = new Column\u003c\u003e(\"portrait\", \"portrait\");\n   //Combination column\n  Column totalColumn1 = new Column(\"Combination name\",column1,column2);\n\n  //tableData  Datas is the data that needs to be filled\n   final TableData\u003cUser\u003e tableData = new TableData\u003c\u003e(\"表格名\",userList,totalColumn1,column3);\n   //set data\n    table = findViewById(R.id.table);\n    //table.setZoom(true,3);//boolean isZoom\n    table.setTableData(tableData);\n\n```\n**- Basic method introduction**\n\n There are two parameters in the \u003e ```Column``` construction method, ```IFormat\u003cT\u003e```, ```IDrawFormat\u003cT\u003e```. ```IFormat\u003cT\u003e``` is used to format the display text, such as the update time field ```time``` timestamp in the ```User``` object. We can rewrite this method if we want to display different formats. ```IDrawFormat\u003cT\u003e``` is used to display the drawing format, such as ```User``` object avatars in the field ```portrait``` time stamp, you can use this method, provides a framework for including several ```IDrawFormat``` (text, Bitmap, Resoure pictures, with pictures).\n\n\n \u003e ```Column``` provides\n\n 1. whether the automatic sorting ```setAutoCount (Boolean isAutoCount).\n 2. whether to arrange ```isReverseSort``` in reverse order\n 3. set sort compare ```setComparator```\n 4. statistical formatting ```setCountFormat```\n 5. click event ```OnColumnItemClickListener```\n\n\n The basic methods in \u003e ```TableData```\n\n 1. set sequence ```setSortColumn```\n 2. set column headings to format ```settitleDrawFormat```\n 3. set the top serial number to format ```setXSequenceFormat```\n 4. set the left serial number to format ```setYSequenceFormat```\n 5. sets whether to display statistics ```setShowCount```\n\n\n\n The basic methods in \u003e ```TableConfig```\n\n 1. set content text style ```setContentStyle```\n 2. set the left sequence text style ```setYSequenceStyle```\n 3. set top sequence text style ```setXSequenceStyle```\n 4. set column heading text style ```setColumnTitleStyle```\n 5. set table title text style ```setTableTitleStyle```\n 6. set statistics row style ```setCountStyle```\n 7. set column header grid style ```setColumnTitleGridStyle```\n 8. set table grid style ```setGridStyle```\n 9. set grid column padding ```setVerticalPadding```\n 10. set grid row padding ```setHorizontalPadding```\n 11. set left sequence background ```setYSequenceBackgroundColor```\n 12. set right sequence background ```setXSequenceBackgroundColor```\n 13. set column header background ```setColumnTitleBackgroundColor```\n 14. set content background ```setContentBackgroundColor```\n 15. setting statistics row background ```setCountBackgroundColor```\n 16. fixed left ```setFixedYSequence```\n 17. fixed top ```setFixedXSequence```\n 18. fixed column headings ```setFixedTitle.\n 19. fixing the first column ```setFixedFirstColumn```\n 20. fixed statistics row```setFixedCountRow```\n\n\n\n ### summary\n\n After writing SmartChart, you have a further understanding of Android drawing. To do SmartTable, just a small demo, after a week of work stealing a write, basically completed the main function table, there have been combined with other functions, because behind not using, then only the beginning design function, has to meet the daily needs.\n\n \u003e the use of tables in Android is very few, and the main screen is out of one page, and the user experience is bad. In the implementation process, try to experience a better sense, I feel through fixed title and first line experience is best, so the default set fixed. Of course, you can set it yourself. There are a lot of pits in it. I hope friends in need can use it.\n## *License*\n\nSmartTable is released under the Apache 2.0 license.\n\n```\nCopyright 2017 Huangyanbin.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at following link.\n\n     http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitat\n","funding_links":[],"categories":["Java"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhuangyanbin%2FsmartTable","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhuangyanbin%2FsmartTable","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhuangyanbin%2FsmartTable/lists"}