html - Ionic Framework responsive table with data attribute not working as expected -
i trying achieve responsive table mobile using ionic framework. using example here (codepen) of codes below too
html
<table> <thead> <tr> <th>payment</th> <th>issue date</th> <th>amount</th> <th>period</th> </tr> </thead> <tbody> <tr> <td data-label="payment">payment #1</td> <td data-label="issue date">02/01/2015</td> <td data-label="amount">$2,311</td> <td data-label="period">01/01/2015 - 01/31/2015</td> </tr> <tr> <td data-label="payment">payment #2</td> <td data-label="issue date">03/01/2015</td> <td data-label="amount">$3,211</td> <td data-label="period">02/01/2015 - 02/28/2015</td> </tr> </tbody> </table> css
body { font-family: arial; } table { border: 1px solid #ccc; width: 100%; margin:0; padding:0; border-collapse: collapse; border-spacing: 0; } table tr { border: 1px solid #ddd; padding: 5px; } table th, table td { padding: 10px; text-align: center; } table th { text-transform: uppercase; font-size: 14px; letter-spacing: 1px; } @media screen , (max-width: 600px) { table { border: 0; } table thead { display: none; } table tr { margin-bottom: 10px; display: block; border-bottom: 2px solid #ddd; } table td { display: block; text-align: right; font-size: 13px; border-bottom: 1px dotted #ccc; } table td:last-child { border-bottom: 0; } table td:before { content: attr(data-label); float: left; text-transform: uppercase; font-weight: bold; } } i have tested example using onsen hybrid framework , on normal website, when max-width of browser or mobile screen below 600px, should picture below

but happened mine when using ionicframework below not aligned should be

the code used same both pictures codepen link given above. missing here made this?
note: if ever there alternative problem, don't mind converting if works.
Comments
Post a Comment