html - Table centered and responsive on screen -


i working on mobile app. need responsive , fit device on width , height. dont know how work images , tables target

this target

enter image description here

but css code

enter image description here

#tablebot{  position: absolute; margin: auto; top: 0; right: 0; bottom: 0; left: 0; width: 100%; height: auto;  } 

and html this

<table id="tablebot"> <tr><td>..img..</td><td>..img</td></tr> <tr><td>..img..</td><td>..img</td></tr> <tr><td>..img..</td><td>..img</td></tr> <tr><td>..img..</td><td>..img</td></tr> </table> 

where img src width=100% , height=auto

i need img on each cell responsive device screen , table centered

i tried vertical aling

thanks!!

you need insert table inside container div, , give margin: 0 auto. in code snipped readjusted table width 90% instead of 100% check it's working:

#tablebot{    position: absolute;  margin: auto;  top: 0;  right: 0;  bottom: 0;  left: 0;  width: 90%;  height: auto;    }    img {    width:100%;    height: auto;  }    .container {    margin: 0 auto;  }
<div class="container">    <table id="tablebot">      <tr><td><img src="https://unsplash.it/200" alt=""> </td><td><img src="https://unsplash.it/200" alt=""></td></tr>      <tr><td><img src="https://unsplash.it/200" alt=""></td><td><img src="https://unsplash.it/200" alt=""></td></tr>      <tr><td><img src="https://unsplash.it/200" alt=""></td><td><img src="https://unsplash.it/200" alt=""></td></tr>      <tr><td><img src="https://unsplash.it/200" alt=""></td><td><img src="https://unsplash.it/200" alt=""></td></tr>    </table>      </div>


Comments

Popular posts from this blog

ubuntu - PHP script to find files of certain extensions in a directory, returns populated array when run in browser, but empty array when run from terminal -

php - How can i create a user dashboard -

javascript - How to detect toggling of the fullscreen-toolbar in jQuery Mobile? -