困っているテーブルがあります。両方のテーブルを同じ幅の Div に並べて配置したいと思います。幅などを手動で設定しようとしましたが、成功しませんでした。
現在はこんな感じ
HTML
<div class = "CoresAreaDiv">
<label class="CoresLabel">CoreShop</label>
<table class="CoreShopTable" >
<tr>
<th>
L1
</th>
<td>@ViewData["L1"]</td>
</tr>
<tr>
<th>L2</th>
<td>@ViewData["L2"]</td>
</tr>
<tr>
<th>L3</th>
<td>@ViewData["L3"]</td>
</tr>
<tr>
<th>L4</th>
<td>@ViewData["L4"]</td>
</tr>
<tr>
<th>L5</th>
<td>@ViewData["L5"]</td>
</tr>
<tr>
<th>L6</th>
<td>@ViewData["L6"]</td>
</tr>
<tr>
<th>L7</th>
<td>@ViewData["L7"]</td>
</tr>
<tr>
<th>L8</th>
<td>@ViewData["L8"]</td>
</tr>
</table>
<table class="CoreShopTable2">
<tr>
<th>L9</th>
<td>@ViewData["L9"]</td>
</tr>
<tr>
<th>L10</th>
<td>@ViewData["L10"]</td>
</tr>
<tr>
<th>L11</th>
<td>@ViewData["L11"]</td>
</tr>
<tr>
<th>L12</th>
<td>@ViewData["L12"]</td>
</tr>
<tr>
<th>L13</th>
<td>@ViewData["L13"]</td>
</tr>
<tr>
<th>L14</th>
<td>@ViewData["L14"]</td>
</tr>
<tr>
<th>L15</th>
<td>@ViewData["L15"]</td>
</tr>
<tr>
<th>L18</th>
<td>@ViewData["L18"]</td>
</tr>
</table>
</div>
以下のCSSコードは
.CoresAreaDiv
{
width:50%;
}
}
table.CoreShopTable
{
text-align: left;
margin: 45px;
border-collapse: collapse;
font-family: "Lucida Sans Unicode" , "Lucida Grande" , Sans-Serif;
width: 20%;;
position: relative;
float: left;
}
table.CoreShopTable th
{
width: 2%;
font-weight: normal;
padding: 8px;
background: #b9c9fe url('table-images/gradhead.png') repeat-x;
border-top: 2px solid #d3ddff;
border-bottom: 1px solid #fff;
color: #039;
font-size: larger;
font-weight: bolder;
text-align: center;
}
table.CoreShopTable td
{
padding: 8px;
border-bottom: 1px solid #fff;
color: #669;
border-top: 1px solid #fff;
background: #e8edff url('table-images/gradback.png') repeat-x;
font-size: larger;
text-align: center;
width: 2%;
}
table.CoreShopTable td:hover
{
background: #d0dafd url(C:\Users\pbrady\Desktop\Code\MvcApplication1\MvcApplication1\Images\gradhover.png);
color: #339;
}
table.CoreShopTable2
{
text-align: left;
margin: 45px;
border-collapse: collapse;
font-family: "Lucida Sans Unicode" , "Lucida Grande" , Sans-Serif;
width: 50px;
float: right;
right: -50px;
top: -357px;
position: relative;
}
table.CoreShopTable2 th
{
width: 20%;
font-weight: normal;
padding: 8px;
background: #b9c9fe url('table-images/gradhead.png') repeat-x;
border-top: 2px solid #d3ddff;
border-bottom: 1px solid #fff;
color: #039;
font-size: larger;
font-weight: bolder;
text-align: center;
}
table.CoreShopTable2 td
{
padding: 8px;
border-bottom: 1px solid #fff;
color: #669;
border-top: 1px solid #fff;
background: #e8edff url('table-images/gradback.png') repeat-x;
font-size: larger;
text-align: center;
}