html - How do I get this div to the center? -


so, got currently:

http://gyazo.com/5d30270a775462fef170283162a9152e

how second sort of table @ same position button, in center? tried everything, can't think of else.

please me!

current code:

    .flat-table {   display: inline-block;   font-family: sans-serif;   -webkit-font-smoothing: antialiased;   font-size: 115%;   overflow: auto;   width: 90%;   text-align: center;   float: right;    }   th {     background-color: #f95252;     color: white;     font-weight: normal;     padding: 20px 30px;     text-align: center;   }   td {     background-color: #fff;     color: rgb(111, 111, 111);     padding: 20px 30px;   } 

this code of table.

what do?

thanks!

make sure surrounding div's floated , align in div center using: margin: 0 auto;

look @ example:

<div class="top">menu</div> <div class="middle">     <table>         <tr><td>test1</td></tr>         <tr><td>test2</td></tr>     </table>     </div> <div class="bottom"><a href="#">button</a></div> 

css:

.top {     height: 40px;     width: 100%;     float: left;     background-color: red; } .middle {     width: 100%;     height: auto;     float: left; } .middle table {     width: 300px;     background-color: grey;     margin: 0 auto;     font-family: sans-serif;     -webkit-font-smoothing: antialiased;     font-size: 115%; } .bottom {     height: 40px;     float: left;     width: 100%;     background-color: blue; } .bottom {     display: block;     width: 100px;     margin: 0 auto;     height: 20px;     background-color: yellow;     line-height: 20px;     text-align: center;     margin-top: 10px; } th {     background-color: #f95252;     color: white;     font-weight: normal;     padding: 20px 30px;     text-align: center; } td {     background-color: #fff;     color: rgb(111, 111, 111);     padding: 20px 30px; } 

Comments

Popular posts from this blog

python - TypeError: start must be a integer -

c# - DevExpress RepositoryItemComboBox BackColor property ignored -

django - Creating multiple model instances in DRF3 -