Last active
October 21, 2016 10:58
-
-
Save alanfm/834a3abda7803f6b719d89191dc264e8 to your computer and use it in GitHub Desktop.
Estrutura
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<style> | |
.table { | |
width: 600px; | |
box-sizing: border-box; | |
border: 1px solid #000; | |
} | |
.row { | |
width: 100%; | |
display: flex; | |
flex-direction: row; | |
} | |
.cell { | |
width: 298px; | |
flex-basis: auto; | |
margin: 2px; | |
padding: 2px; | |
border: 1px solid #000; | |
text-align: center; | |
} | |
.t-head { | |
text-align: center; | |
font-weight: bold; | |
} | |
</style> | |
<?php | |
/** | |
* Esse vetor representa o resultado da sua consulta no banco de dados | |
*/ | |
$v = [['id'=>1, 'name'=>'Fulano', 'role'=>'Programador'], | |
['id'=>2, 'name'=>'Sicrano', 'role'=>'Analista'], | |
['id'=>3, 'name'=>'Beltrano', 'role'=>'DBA']]; | |
?> | |
<div class="table"> | |
<div class="row"> | |
<div class="cell t-head">#id</div> | |
<div class="cell t-head">Name</div> | |
<div class="cell t-head">Role</div> | |
</div> | |
<?php foreach($v as $value): ?> | |
<div class="row"> | |
<div class="cell"><?=$value['id'];?></div> | |
<div class="cell"><?=$value['name'];?></div> | |
<div class="cell"><?=$value['role'];?></div> | |
</div> | |
<?php endforeach;?> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment