1.0.9 • Published 3 years ago

simple-react-native-table v1.0.9

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

����# react-native-tableview

The TableView component is for outputting data in table format. The following constitute the props for the TableView Component:

  1. title - title for the table, default is Data Table,
  2. titleColor - color of title text, default is dodgerblue,
  3. defaultColor- the default color for general use in the table eg in horizontal lines. Default is dodgerblue,
  4. data - the data to show in the table eg, { firstName: "Test 1 Firstname", lastName: "Test 1 Lastname", age: 5, }, { firstName: "Test 2 Firstname", lastName: "Test 2 Lastname", age: 30, }, { firstName: "Test 3 Firstname", lastName: "Test 3 Lastname", age: 45, }...

  5. headers - the array of header objects with field names as in data in the form: { field: "firstName", title: "First Name", size: "34%" }, { field: "lastName", title: "Last Name", size: "33%" }, { field: "age", title: "Age", size: "33%" }

  • the size is the width of the column relative to other columns(expressed as a %)
  • title becomes the column header
  • field is the key to extract data, example: celldata=datafield
  1. paginate - flag to determine whether to show pagination controls, defaults to true,
  2. setItemsPerPage - the function to set itemPerPage value (implement using useState hook),,
  3. setPage - the function to set page value (implement using useState hook),
  4. page - the initial page to render, default is 0.
  5. itemsPerPage - initial number of items per page. Preferably on of the elements of pageOptions,
  6. pageOptions - the array of number of Items per page options eg 5,10,20,
  7. headerColor - color of the headers, default is dodgerblue.
  8. firstColumnColor - color to apply to first column text, default is dodgerblue.
  9. footerColor - color to apply to footer component text, default is "dodgerblue".
  10. highlightRows - prop to highlight rows and make stripped table, default is true.
  11. highlightColumns - prop to highlight column backgrounds, only visible in the header, default is false
  12. padding - the horizontal padding that separates cells ie. separates columns
  13. alignColumns - alignment style for all other columns except first column, defaiult is "center".
  14. alignFirstColumn -alignment style for first column contents, default is "flex-start".

EXAMPLE