Create Simple and perfect Responsive table using css3 and jquery | Sanwebcorner

Create Simple and perfect Responsive table using css3 and jquery

Now i am going to explain about how to create responsive table using css3 and jquery. The responsive table is some tricky because of the width of the table is based on the number of datas (records). So we can't able to maintain that much of records in that particular table format in mobile view or smaller devices. So that will rearrange the format of the table when it comes responsive.



The above Example is one of the best responsive table because it shows the table in different format in responsive view.If you enter n number of records also it shows perfectly when responsive. You can change the css code according to the your website.


Html

<div id="page">
  <table id="table">
    <thead>
      <tr>
        <th>Name</th>
        <th>Age</th>
        <th>Designation</th>
        <th>Salary</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td>Sanraj</td>
        <td>28</td>
        <td>Web Developer</td>
        <td>10,000</td>
      </tr>
      <tr>
        <td>Ramkumar</td>
        <td>22</td>
        <td>Web Developer</td>
        <td>20,000</td>
      </tr>
      <tr>
        <td>Saravan</td>
        <td>23</td>
        <td>Web Designer</td>
        <td>18,000</td>
      </tr>
      <tr>
        <td>Ramraj</td>
        <td>32</td>
        <td>Web Developer</td>
        <td>40,000</td>
      </tr>
      <tr>
        <td>John</td>
        <td>22</td>
        <td>Tester</td>
        <td>20,000</td>
      </tr>
    </tbody>
  </table>
</div>
</body>
</html>

Css:

.bt-wrapper.active {
  margin-top: 1.5em;
}
.bt-wrapper.active table {
  margin: 0;
}


table {
  width: 100%;
}
.table {
  margin: 30px 0;
  border-collapse: collapse;
  border-spacing: 0;
  empty-cells: show;
  border: 1px solid #e0e0e0;
}
.table caption {
  color: #333;
  font-style: italic;
  font-size: 85%;
  line-height: 1;
  padding: 1em 0;
  text-align: center;
}
.table td,
.table th {
  border-left: 1px solid #e0e0e0;
  border-width: 0 0 0 1px;
  font-size: inherit;
  margin: 0;
  overflow: visible;
  padding: 0.5em 1em;
  font-weight: normal;
}
.table td:first-child,
.table th:first-child {
  border-left-width: 0;
}
.table thead,
.table tfoot {
  background-color: #f05050;
  color: #fff;
  text-align: left;
  vertical-align: bottom;
}
.table thead td,
.table tfoot td,
.table thead th,
.table tfoot th {
  border-color: #fff;
}
.table td {
  background-color: transparent;
}
.table_striped tr:nth-child(2n-1) td {
  background-color: #ececec;
}
.table_bordered td {
  border-bottom: 1px solid #e0e0e0;
}
.table_bordered tbody > tr:last-child > td,
.table_bordered thead > tr:last-child > td {
  border-bottom-width: 0;
}
.table_horizontal td,
.table_horizontal th {
  border-width: 0 0 1px 0;
  border-bottom: 1px solid #e0e0e0;
}
.table_horizontal tbody > tr:last-child > td,
.table_horizontal thead > tr:last-child > td {
  border-bottom-width: 0;
}

Post a Comment

Labels

360 degree view product image 3d rotate 3d text 3step-form Accordion menu ajax All Browsers Animated Background Gradient animation audio controller auto complete Best accordion menu bootstrap border bounce effect on hover Breadcrumb calculate age by dob calendar Captcha change image on mouse move color chooser countdown Counter on scroll create random number Css css animation css buttons css hover css3 customized upload Button Date picker delete data from table Different scroll speed email otp verification email verifier Embed eventlist Expanding Menu feedbck form flash news section close button full screen menu Google custom search Google Maps Google reCAPTCHA Google site search gradient hide menu Horizontal News ticker Hover Htm Html html dropdown html form html5 html5 form validation Iframe image hover increment decrement textbox value based on select box Javascript Jquery js Layered image effect on mouse hover lock & unlock page scroll marquee marquee with close button mobile number validation mobile otp login Multi-level-drop-down-menu multi-level-form Multi-Step-form mysql News ticker on hover change text to image our team page password generator password strength checker Photoshop PHP populate html selectbox Popup image on click the link pure css Question type form random number generate Random password Redirect page Based on the select box while submit the form responsive responsive menu responsive popup box Responsive Vertical Time line design rotate image selectbox based on select box simple coming soon page simple countdown based on end date simple typing effect slider sliding tab sms otp login statistic counter on scroll switch tag shape team member Time picker toggle toggle view transparent button underline animation up down slide validation vertical fixed sidebar Webtips Youtube