Jump to content
Fórum Script Brasil
  • 0

Tabelas HTML


Muriloftto
 Share

Question

Saudações galera, tenho uma dúvida na organização das tabelas no html por exemplo quero deixar as duas centralizadas, como podem ver no anexo não e isso que acontece,são duas query diferentes,segue o código 

 

?>
 
<table border="1" width="10%" align="center" cellspacing="6">
<tr>
<td width="10%" align="center">Hora</td>
<td width="10%" align="center">Data</td>
<td width="10%" align="center">IndexTag</td>
<td width="10%" align="center">Valor</td>


<?


while (odbc_fetch_row($rs)) {
?>  <td>
  <tr>
    <td width="80"><?php echo odbc_result($rs,"HORA")?></td>
    <td width="108"><?php echo odbc_result($rs,"DATA")?></td>
    <td width="27"><?php echo odbc_result($rs,"tagindex")?></td>
    <td width="50"><?php echo odbc_result($rs,"val")?></td>
  

<?php
}

  ?>  
</tr>
</table>  
  
 <?
 ?>
<table border="1" width="10%" align="left" and align="center" cellspacing="6">
<tr>
<td width="10%" align="left">Hora</td>
<td width="10%" align="left">Data</td>
<td width="10%" align="left">IndexTag</td>
<td width="10%" align="left">Valor</td>


<?


while (odbc_fetch_row($rr)) {
?>  <td>
  <tr>
    <td width="80"><?php echo odbc_result($rs,"HORA")?></td>
    <td width="108"><?php echo odbc_result($rs,"DATA")?></td>
    <td width="27"><?php echo odbc_result($rs,"tagindex")?></td>
    <td width="50"><?php echo odbc_result($rs,"val")?></td>
  

<?php
}

  ?>  
</tr>
</table>  

teste.png

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 0

Olá!

Coloque as tabelas dentro de algum elemento que vamos identificar como container. ex.:

<div id='container'>

<table>...</table>

<table>...</table>

</div>

no seu css faça assim:

div#container{

text-align:center;

}

div#container > table{

display:inline-table;

}

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Forum Statistics

    • Total Topics
      149.6k
    • Total Posts
      646.2k
×
×
  • Create New...