-1

I have two tables that show data from database.

Now I set 1st table for headlines and 2nd table for the data.

I set like this

<table class="t_status">
    <td>No</td>
    <td>Name</td>
    <td>Address</td>
</table>

In table #2

<table class="t_status">
    <td>1</td>
    <td>Michael</td>
    <td>California</td>
<tr>
    <td>2</td>
    <td>Greg</td>
    <td>LA</td>

Now facing the problem when data display, table 1 and table 2 set different width.

This is the CSS

table
{
empty-cells: show;
border-collapse: collapse;
width: 100%;
}

.t_status
{
border-collapse: collapse;
background: #fff;
border: 1px solid #d9d9d9;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;
width: 100%;    
margin-top: -1px;
}

.t_status td, th
{
border-top: 1px solid #c0c0c0;
border-bottom: 1px solid #c0c0c0;
border-left: 1px solid #c0c0c0;
border-right: 1px solid #c0c0c0;
padding: 10px;
font-size: 40pt;
font-weight: bold;
}

.t_status td
{
color: #fff;
background-color: #000;
}

.t_status th
{
font-size: 40pt;
color: #fff;
}
4

5 に答える 5

0

HTML 構文が正しくありません。tr タグを使用する:-

<table class="t_status">
<tr>
   <td>No</td>
   <td>Name</td>
   <td>Address</td>
</tr>
</table>
于 2013-05-03T09:01:49.317 に答える
0

次のように配置してみてください。

<table class="t_status">
<tr>
   <td>No</td>
   <td>Name</td>
   <td>Address</td>
</tr>
</table>

<table class="t_status">
<tr>
   <td>1</td>
   <td>Michael</td>
   <td>California</td>
</tr>
<tr>
  <td>2</td>
  <td>Greg</td>
  <td>LA</td>
</tr>
</table>
于 2013-05-03T08:57:55.933 に答える