html - Find Bootstrap div with 100% width correct behavior -
i'm trying overflow table in bootstrap loader div has 100% width.
i've made fiddle here:
https://jsfiddle.net/dtchh/18316/
here's code:
html:
<div class="container"> <div class="row"> <div class="col-md-12"> <div id="loadertable"></div> <table class="table-bordered table-striped table-condensed" width="100%"> <thead> <th>data inizio</th> <th>ora inizio</th> <th>data fine</th> <th>ora fine</th> <th>attività</th> <th>struttura</th> <th>dettagli</th> <th>salva evento</th> <th>stato</th> </thead> <tbody> <tr> <td data-title="data inizio" id="prest_data_inizio">12/04/2016</td> <td data-title="ora inizio" id="prest_ora_inizio">09:00</td> <td data-title="data fine" id="prest_data_fine">12/04/2016</td> <td data-title="ora fine" id="prest_ora_fine">18:00</td> <td data-title="attività" id="prest_attivita">attività di ambulatorio</td> <td data-title="struttura" id="prest_struttura">6</td> <td data-title="dettagli" id="prest_dettagli"><a href="javascript:void(0);"><i class="fa fa-chevron-circle-down"></i></a></td> <td data-title="salva evento" id="prest_salva"><a href="javascript:void(0);"><i class="fa fa-calendar"></i></a></td> <td data-title="stato" id="prest_stato">9</td> </tr> <tr class="prest_dettagli_box"> <td data-title="dettagli" colspan="9"> <span>lorem ipsum dolor sit amet, consectetur adipiscing elit, sed eiusmod tempor incididunt ut labore et dolore magna aliqua. ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</span> </td> </tr> </tbody> <tfoot> </tfoot> </table> </div> </div> </div>
css:
#loadertable { width: 100%; height: 100%; position: absolute; z-index: 10; background: rgba(255, 0, 0, 0.5) url(http://www.nasa.gov/multimedia/videogallery/ajax-loader.gif) no-repeat center center; top: 0; left: 0; }
i don't understand loader div width behavior (100% width) because if div nested inside row , col-md-12
should not go outside didn't understand grid philosophy in case.
can suggest me right way put loader div above table filling 100% of width?
this happened because parent relative
position col-md-12
, has padding:0 15px
so, need wrap table div
, give position:relative
/* latest compiled , minified css included external resource*/ /* optional theme */ #loadertable { width: 100%; height: 100%; position: absolute; z-index: 10; background: rgba(255, 0, 0, 0.5) url(http://www.nasa.gov/multimedia/videogallery/ajax-loader.gif) no-repeat center center; top: 0; left: 0; } .wrapper { position:relative; }
<link href="//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css" rel="stylesheet"/> <div class="container"> <div class="row"> <div class="col-md-12"> <div class="wrapper"> <div id="loadertable"></div> <table class="table-bordered table-striped table-condensed" width="100%"> <thead> <th>data inizio</th> <th>ora inizio</th> <th>data fine</th> <th>ora fine</th> <th>attività</th> <th>struttura</th> <th>dettagli</th> <th>salva evento</th> <th>stato</th> </thead> <tbody> <tr> <td data-title="data inizio" id="prest_data_inizio">12/04/2016</td> <td data-title="ora inizio" id="prest_ora_inizio">09:00</td> <td data-title="data fine" id="prest_data_fine">12/04/2016</td> <td data-title="ora fine" id="prest_ora_fine">18:00</td> <td data-title="attività" id="prest_attivita">attività di ambulatorio</td> <td data-title="struttura" id="prest_struttura">6</td> <td data-title="dettagli" id="prest_dettagli"><a href="javascript:void(0);"><i class="fa fa-chevron-circle-down"></i></a></td> <td data-title="salva evento" id="prest_salva"><a href="javascript:void(0);"><i class="fa fa-calendar"></i></a></td> <td data-title="stato" id="prest_stato">9</td> </tr> <tr class="prest_dettagli_box"> <td data-title="dettagli" colspan="9"> <span>lorem ipsum dolor sit amet, consectetur adipiscing elit, sed eiusmod tempor incididunt ut labore et dolore magna aliqua. ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</span> </td> </tr> </tbody> <tfoot> </tfoot> </table> </div> </div> </div> </div>
Comments
Post a Comment