Html 在DIV内调整CSS表大小
我有一张桌子有点问题。我想要两张桌子并排放在沙发上,两张桌子的宽度都一样。我曾尝试手动设置宽度ect,但没有成功,任何帮助都将是巨大的 现在看起来是这样 Html 它起作用了Html 在DIV内调整CSS表大小,html,css,Html,Css,我有一张桌子有点问题。我想要两张桌子并排放在沙发上,两张桌子的宽度都一样。我曾尝试手动设置宽度ect,但没有成功,任何帮助都将是巨大的 现在看起来是这样 Html 它起作用了 <div width="100%"> <table width="48%"> //your stuff </table> <table width="48%"> //your stuff </table> </div> //你的东西 //你的东西
<div width="100%">
<table width="48%">
//your stuff
</table>
<table width="48%">
//your stuff
</table>
</div>
//你的东西
//你的东西
工作台宽度最大可达50%。。
如果它不适合你,那么使用float:left 它起作用了
<div width="100%">
<table width="48%">
//your stuff
</table>
<table width="48%">
//your stuff
</table>
</div>
//你的东西
//你的东西
工作台宽度最大可达50%。。
如果它不适合你,那么使用float:left 这是一把小提琴: 我花了一段时间才弄明白你的问题是什么
}
。导致样式表无法正确加载宽度:50%代码>。但是在一个普通的页面上,你应该有足够的空间,这样你就可以把它带回来
位置:相对代码>到处都是,还有不必要的顶部
和右侧
声明。用一些
边距去破坏一切的表格。所有这些都随风而逝th
和td
的width
和padding
声明(其中一些声明是2%
,一些声明是20%
,另一些声明是50px
,哥们..太乱了,需要时把它们拿回来。它们不应该影响布局
来将表格与标签分开边距
&填充
,以获得所有可用空间的使用(使用*
选择器)<div class="CoresAreaDiv">
<label class="CoresLabel">CoreShop</label>
<br/>
<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="CoreShopTable">
<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>
*
{
margin:0;
padding: 0;
}
table.CoreShopTable
{
border-collapse: collapse;
font-family:"Lucida Sans Unicode", "Lucida Grande", Sans-Serif;
width: 50%;
float: left;
}
table.CoreShopTable th {
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;
}
table.CoreShopTable td
{
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;
}
table.CoreShopTable td:hover {
background: #d0dafd url(C:\Users\pbrady\Desktop\Code\MvcApplication1\MvcApplication1\Images\gradhover.png);
color: #339;
}
这是一把小提琴: 我花了一段时间才弄明白你的问题是什么
}
。导致样式表无法正确加载宽度:50%;
。但是在常规页面上,您应该有足够的空间,以便可以将其带回来position:relative;
到处都是,还有不必要的top
和right
声明。还有一些空白
到那些毁掉一切的表格。所有这些都随风而去了th
和td
的width
和padding
声明(其中一些声明是2%
,一些声明是20%
,另一些声明是50px
,哥们..太乱了,需要时把它们拿回来。它们不应该影响布局
来将表格与标签分开边距
&填充
,以获得所有可用空间的使用(使用*
选择器)<div class="CoresAreaDiv">
<label class="CoresLabel">CoreShop</label>
<br/>
<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="CoreShopTable">
<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>
*
{
margin:0;
padding: 0;
}
table.CoreShopTable
{
border-collapse: collapse;
font-family:"Lucida Sans Unicode", "Lucida Grande", Sans-Serif;
width: 50%;
float: left;
}
table.CoreShopTable th {
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;
}
table.CoreShopTable td
{
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;
}
table.CoreShopTable td:hover {
background: #d0dafd url(C:\Users\pbrady\Desktop\Code\MvcApplication1\MvcApplication1\Images\gradhover.png);
color: #339;
}
它可能是div,它在保留表格,我不明白你为什么不在表格的另一行,不只是同一个表格,但我相信你有你的理由
.CoresAreaDiv {
margin: 0;
padding: 0;
}
或者
您可以删除第二个表的左边框:
.CoreShopTable2 tr {
border-left: none;
margin-left: 0; /* to make sure there is still no awkward space */
}
或者保留边框,无论它可能是div,它是在保留表格,我不明白为什么你不在表格的另一行,而不仅仅是同一个表格,但我相信你有你的理由
.CoresAreaDiv {
margin: 0;
padding: 0;
}
或者
您可以删除第二个表的左边框:
.CoreShopTable2 tr {
border-left: none;
margin-left: 0; /* to make sure there is still no awkward space */
}
或者保留边框,无论哪个请同时显示HTML…您需要查看您的宽度-一些tds设置为2%,第二个表设置为50px-对这些进行排序,它应该可以正常工作请同时显示HTML…您需要查看您的宽度-一些tds设置为2%,第二个表设置为50px-对这些进行排序d它应该可以正常工作。我已经使用了这两种方法,但都没有乐趣,因为你的CSS中有其他问题。一般来说,他的解决方案是正确的。我已经使用了这两种方法,但都没有乐趣,因为你的CSS中有其他问题。一般来说,他的解决方案是正确的。