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
but css code
#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
Post a Comment