GitXplorerGitXplorer
m

remark-responsive-tables

public
2 stars
3 forks
1 issues

Commits

List of commits on branch master.
Verified
ef997c48b37f57d47f1bcbaee71b88e6e0793bb7

Merge pull request #1 from chenxsan/bugfix/fix-empty-head

mmontogeek committed 4 years ago
Unverified
6d363c396d21ac6150e24bf414050865befbe591

fix for empty head

cchenxsan committed 4 years ago
Unverified
17e3aadad93e7bc00fc3fed08fa689f4d9428481

Initial commit

mmontogeek committed 6 years ago
Verified
9b925efb364165acf739c44c4fb2135da837a2e0

Initial commit

mmontogeek committed 6 years ago

README

The README file for this repository.

remark-responsible-tables

Creates a responsibe table by extracting thead titles and injecting them into each tbody row, those are hidded by default on desktop with CSS and displayed on mobile.

Options

classnames (required) Object

Classnames for each element:

  • title: thead titles
  • description: Second column description
  • content: Element that encapsulates description shown on mobile
  • mobile: Media query class for mobile
  • description: Media query class for desktop
{
  'title': 'title',
  'description': 'description',
  'content': 'content',
  'mobile': 'mobile',
  'desktop': 'desktop'
}

Example

Mobile

image

Desktop

image

Code

Options

{
  'classnames': {
    'title': 'title',
    'description': 'description',
    'content': 'content',
    'mobile': 'mobile',
    'desktop': 'desktop'
  }
}
thead {
  display: none;

  /* Mobile */
   {
    display: table-header-group;
  }
}

td {
  display: flex;
  flex-basis: 100%;
  align-self: stretch;

  /* Mobile */
   {
    display: table-cell;
  }
}

.titles {
  display: flex;
  flex-direction: column;
  justify-content: baseline;

  /* Mobile */
   {
    display: none;
  }
}

.content {
  display: flex;
  flex-direction: column;
  justify-content: baseline;
}

.description.desktop {
  display: none;

  /* Mobile */
   {
    display: block;
  }
}

.description.mobile {
  /* Mobile */
   {
    display: none;
  }
}