JSFiddle - React, Tailwind, and code Playground
by luchaninov
HTML
<script src="https://raw.github.com/YuriyLuchaninov/tagjs/master/tag.js"></script>
<script src="https://raw.github.com/YuriyLuchaninov/tagjs/master/examples/expandable-table/expandable-table.js"></script>
<table id="data-table" w-component="accordion-table">
<thead>
<tr>
<td>Priority</td>
<td>Priority</td>
</tr>
</thead>
<tfoot>
<tr>
<td colspan="2">Patient Name</td>
</tr>
</tfoot>
<tbody>
<tr w-component="accordion-table-row">
<td colspan="2">
Peter Pen (click to show details)
</td>
</tr>
<tr w-component="accordion-table-row-content">
<td colspan="2">
<span>Adolph Blaine Charles David Earl Frederick Jack Gerald Hubert Irvin John Kenneth Lloyd Martin Nero
Oliver Paul Quincy Randolph Sherman Thomas Uncas Victor William Xerxes Yancy Zeus
Wolfeschlegelsteinhausenbergerdorft Senior</span>
</td>
</tr>
<tr w-component="accordion-table-row">
<td colspan="2">
Tomas Non (click to show details)
</td>
</tr>
<tr w-component="accordion-table-row-content">
<td>
<span>Adolph Blaine Charles David Earl Frederick Jack Gerald Hubert Irvin John Kenneth Lloyd Martin Nero
Oliver Paul Quincy Randolph Sherman Thomas Uncas Victor William Xerxes Yancy Zeus
Wolfeschlegelsteinhausenbergerdorft Senior</span>
</td>
<td>
<span>Adolph Blaine Charles David Earl Frederick Jack Gerald Hubert Irvin John Kenneth Lloyd Martin Nero
Oliver Paul Quincy Randolph Sherman Thomas Uncas Victor William Xerxes Yancy Zeus
Wolfeschlegelsteinhausenbergerdorft Senior</span>
</td>
</tr>
<tr w-component="accordion-table-row">
<td colspan="2">
Peter Pen (click to show details)
</td>
</tr>
<tr w-component="accordion-table-row-content">
<td colspan="2">
...
CSS
html,
body {
margin: 0;
padding: 0;
height: 100%;
}
body {
font: 14px/20px 'Arial';
color: #333;
margin: 20px auto;
width: 600px;
}
ul{
margin: 0;
padding: 0;
list-style: none;
}
.menu a{
color: #333;
display: block;
padding:5px 10px;
text-decoration: none;
}
.menu a:hover{
background: rgba(0,0,0,0.1);
}
.content {
padding: 5px 10px;
}
/*component*/
.accordion-table {
border-collapse: collapse;
border-spacing: 0;
}
.accordion-table .accordion-table-row-content .outer {
overflow: hidden;
height: 0;
-webkit-transition: all 0.35s ease;
-moz-transition: all 0.35s ease;
-o-transition: all 0.35s ease;
-ms-transition: all 0.35s ease;
transition: all 0.35s ease;
}
/*style*/
.accordion-table {
background: #fdfdfd;
-webkit-box-shadow: 0 10px 20px -10px #999 ;
-moz-box-shadow: 0 10px 20px -10px #999 ;
-ms-box-shadow: 0 10px 20px -10px #999 ;
box-shadow: 0 10px 20px -10px #999 ;
}
.accordion-table td{padding: 10px;}
.accordion-table-row-content td{padding:0}
.accordion-table-row-content .inner{
padding: 10px;
background: #f7fbff;
}
.accordion-table thead td{
font-weight: bold;
color: #172c47;
text-shadow: 1px 1px 0 #3e88cb, 0 0 1px #31659a, 0 0 1px #31659a;
background: #429ee5;
background: -moz-linear-gradient(top, #429ee5 0%, #1e5799 100%);
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#429ee5), color-stop(100%,#1e5799));
background: -webkit-linear-gradient(top, #429ee5 0%,#1e5799 100%);
background: -o-linear-gradient(top, #429ee5 0%,#1e5799 100%);
background: -ms-linear-gradient(top, #429ee5 0%,#1e5799 100%);
background: linear-gradient(to bottom, #429ee5 0%,#1e5799 100%);
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#429ee5', endColorstr='#1e5799',GradientType=0 );
}
.accordion-table tbody tr:nth-child(4n-1) td{ background: #f0f0f0;...
JavaScript
$TB.apply($('#data-table').get(0));