Table Pagination

Such a question. There is a very long table that does not fit in the :-)width. The cell width is determined automatically (the content is something like this: XXXX-XX-XX). I want to make it so that it is displayed in portions (page by page). What suggestions will you have on how to do this, given that the screen size is not fixed in any way. You can use JavaScript.


Answer 1, authority 100%

C_new = C_page - 2 * C_delta;
C_start = Num_page * C_new - C_delta;
C_end = Num_page * C_new + C_delta;
if ( C_start < 0 ){
  C_start = 0;
  C_end += C_delta;
}
if ( C_end > C_max ) C_end = C_max;

On page load:

  1. W_all– Check browser window width via js
  2. W– Calculate table space
  3. W_col– Column width (preferably the same)
  4. Num_page– Page number
  5. C_page = ( W/W_col )– Number of columns per page
  6. C_delta– Column overlap on the page ( +- 5 columns )
  7. C_new– Number of columns not shown before
  8. C_start– Number of the first column of the page
  9. C_end– Number of the last column of the page
  10. C_max– Most recent column

Somehow…