首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >在桌子上方的标题不符合分辨率

在桌子上方的标题不符合分辨率
EN

Stack Overflow用户
提问于 2014-04-22 06:45:00
回答 3查看 87关注 0票数 0

我有一个HTML的每周报告,两个部分并排。tr中的一个部分在其上方有一个标题,第2部分有一个类似的标题。我编写了一个简单的tr th来显示标题。但是现在我想要一个标题放在这个表的上方。我编写了一个div来像这样显示标题:

代码语言:javascript
运行
复制
<div style="float:right;width:70%; font-weight: bold">
  Weekly Recordable Incident Rate&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  Weekly Lost Time Incident Rate
</div>.

但这会影响决议。当您最小化浏览器时,标题向左-右。

有人能帮我一下吗?

代码语言:javascript
运行
复制
    <table cellpadding="0" cellspacing="0" width="100%">
       <div style="float:right;width:70%; font-weight: bold">
          Weekly Recordable Incident Rate&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;    Weekly Lost Time Incident Rate
       </div>   

       <tr>
          <th><span style='color:white;margin-right:1.00cm;'>&nbsp;</span></th>
          <th colspan="2" class="bluebg">Wk1 </th>
          <th colspan="2" class="bluebg">Wk2 </th>
          <th colspan="2" class="bluebg">Wk3 </th>
          <th colspan="2" class="bluebg">Wk4 </th>
          <th colspan="2" class="bluebg">Wk5 </th>
          <th class="whitebg">&nbsp;</th>
          <th class="bluebg">Wk2 </th>
          <th class="bluebg">Wk3 </th>
          <th class="bluebg">Wk4 </th>
          <th class="bluebg">Wk5 </th>
          <th class="bluebg">Wk6 </th>  
       </tr>

       <tr> 
          <th><span style='color:white;margin-right:2.00cm;'>&nbsp;</span></th>
          <td style="border-bottom-color: white;">Recs</td>
          <td style="border-bottom-color: white;">RIR</td>
          <td style="border-bottom-color: white;">Recs</td>
          <td style="border-bottom-color: white;">RIR</td>
          <td style="border-bottom-color: white;">Recs</td>
          <td style="border-bottom-color: white;">RIR</td>
          <td style="border-bottom-color: white;">Recs</td>
          <td style="border-bottom-color: white;">RIR</td>
          <td style="border-bottom-color: white;">Recs</td>
          <td style="border-bottom-color: white;">RIR</td>
       </tr>  

</table>

EN

回答 3

Stack Overflow用户

发布于 2014-04-22 07:17:02

this给我们所有的css,所以我会完整地完成它,但是请检查这个one..may,它会有帮助的。

代码语言:javascript
运行
复制
<table border="1">
<tr height="20px;">  <td colspan="17"><div style="width:100%; font-weight: bold">
      <div style="float: right;margin: 0 auto;width: 44%; ">Weekly Recordable Incident Rate</div><div style="float: right;
    margin: 0 auto;width: 44%;">Weekly Lost Time Incident Rate</div><div style="clear:both;"></div>
   </div> </td></tr>
   <tr>
      <th><span style="color:white;margin-right:1.00cm;width:10px;">&nbsp;</span></th>
      <th colspan="2" class="bluebg">Wk1 </th>
      <th colspan="2" class="bluebg">Wk2 </th>
      <th colspan="2" class="bluebg">Wk3 </th>
      <th colspan="2" class="bluebg">Wk4 </th>
      <th colspan="2" class="bluebg">Wk5 </th>
      <th class="whitebg">&nbsp;</th>
      <th class="bluebg">Wk2 </th>
      <th class="bluebg">Wk3 </th>
      <th class="bluebg">Wk4 </th>
      <th class="bluebg">Wk5 </th>
      <th class="bluebg">Wk6 </th>  
   </tr>
   <tr> 
      <th><span style="color:white;margin-right:2.00cm;">&nbsp;</span>  </th>
      <td style="border-bottom-color: white;">Recs</td>
      <td style="border-bottom-color: white;">RIR</td>
      <td style="border-bottom-color: white;">Recs</td>
      <td style="border-bottom-color: white;">RIR</td>
      <td style="border-bottom-color: white;">Recs</td>
      <td style="border-bottom-color: white;">RIR</td>
      <td style="border-bottom-color: white;">Recs</td>
      <td style="border-bottom-color: white;">RIR</td>
      <td style="border-bottom-color: white;">Recs</td>
      <td style="border-bottom-color: white;">RIR</td>
   </tr>  
  </table>

对不起,因为我只是乞丐,但我希望通过这个,你会得到提示,得到你想要的解决方案。

票数 1
EN

Stack Overflow用户

发布于 2014-04-22 09:03:24

Avinafh :当div宽度分别设置为60和44时

票数 0
EN

Stack Overflow用户

发布于 2014-04-22 09:28:13

这就是我会做的。

代码语言:javascript
运行
复制
<table cellpadding="0" cellspacing="0" width="100%">
  <tr>
    <th></th>
    <th colspan="10" style="text-align:center">Weekly Recordable Incident Rate</th>
    <th></th>
    <th colspan="5" style="text-align:center">Weekly Lost Time Incident Rate</th>
  </tr>
  <tr>
    <th><span style='color:white;margin-right:1.00cm;'>&nbsp;</span></th>
    <th colspan="2" class="bluebg">Wk1</th>
    <th colspan="2" class="bluebg">Wk2</th>
    <th colspan="2" class="bluebg">Wk3</th>
    <th colspan="2" class="bluebg">Wk4</th>
    <th colspan="2" class="bluebg">Wk5</th>
    <th class="whitebg">&nbsp;</th>
    <th class="bluebg">Wk2</th>
    <th class="bluebg">Wk3</th>
    <th class="bluebg">Wk4</th>
    <th class="bluebg">Wk5</th>
    <th class="bluebg">Wk6</th>
  </tr>
  <tr>
    <th><span style='color:white;margin-right:2.00cm;'>&nbsp;</span></th>
    <td style="border-bottom-color: white;">Recs</td>
    <td style="border-bottom-color: white;">RIR</td>
    <td style="border-bottom-color: white;">Recs</td>
    <td style="border-bottom-color: white;">RIR</td>
    <td style="border-bottom-color: white;">Recs</td>
    <td style="border-bottom-color: white;">RIR</td>
    <td style="border-bottom-color: white;">Recs</td>
    <td style="border-bottom-color: white;">RIR</td>
    <td style="border-bottom-color: white;">Recs</td>
    <td style="border-bottom-color: white;">RIR</td>
  </tr>
</table>
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/23212334

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档