4

我有一个网页,我试图让所有浏览器的边框都正确。请参阅http://dl.dropbox.com/u/17256431/SpreadsheetConverter/border-3/border-3.htm

该网页具有html 5 doctype,并且表格的样式为border-collapse:collapse。所需的结果如 Chrome 中所示。看在此处输入图像描述

但是,在 IE 9 中,不呈现边框。请参阅在此处输入图像描述 内容为“j”的单元格定义了上边框 = 2px。

如果我在 IE 9 中以 Quirks 模式查看,结果将与 Chrome 中的相同。为什么用border-collapse:collapse 2px 和 0px 的边框合并成 0px?

由于我的应用程序限制,我需要使用 html 5 doctype 和border-collapse:collapse。

我在这里想念什么吗?有任何想法吗?

提前致谢!

4

1 回答 1

0

出色地,

  1. 对于 CSS 里面*.ee121添加{position: absolute; margin-top: -2px; width: 189px;}
  2. 里面*.ee126{position: absolute; width: 186px;}

/* begin: toolbar styles */

.toolbar {
  margin-top: 5px;
  background-color: #f1f1f1;
  z-index: -1;
  border-top: solid 4px #ff9c08;
  border-bottom: solid 2px #D9d8CE;
  display: inline-block;
  height: 54px;
  width: 100%;
}
.toolbar-upper {
  margin-top: 5px;
  background-color: #f1f1f1;
  z-index: -1;
  border-bottom: solid 4px #ff9c08;
  border-top: solid 2px #D9d8CE;
  display: inline-block;
  height: 54px;
  width: 100%;
}
.toolbar .tlb-btn {
  text-shadow: 0 -1px 0 rgba(0, 0, 0, .25);
  cursor: pointer;
  text-align: center;
}
.toolbar .tlb-elm {
  height: 22px;
}
.toolbar-upper .tlb-elm {
  height: 22px;
}
.toolpanel {
  float: left;
  margin: 16px 0 0 16px;
}
.toolbarGreenbtn {
  background: -webkit-gradient(linear, left top, left bottom, color-stop(0.05, #79c979), color-stop(1, #009900));
  background: -moz-linear-gradient(center top, #79c979 5%, #009900 100%);
  background-color: #009900;
  -moz-border-radius: 4px;
  -webkit-border-radius: 4px;
  border-radius: 4px;
  border: 1px solid #009900;
  display: inline-block;
  color: #ffffff;
  font-family: arial;
  font-size: .8em;
  font-weight: bold;
  padding: 0 14px;
  text-decoration: none;
  margin: 0;
  height: 100%;
}
.toolbarBluebtn {
  background: -webkit-gradient(linear, left top, left bottom, color-stop(0.05, #3d94f6), color-stop(1, #1e62d0));
  background: -moz-linear-gradient(center top, #3d94f6 5%, #1e62d0 100%);
  background-color: #1e62d0;
  -moz-border-radius: 4px;
  -webkit-border-radius: 4px;
  border-radius: 4px;
  border: 1px solid #075bd1;
  display: inline-block;
  color: #ffffff;
  font-family: arial;
  font-size: .8em;
  font-weight: bold;
  padding: 0 14px;
  text-decoration: none;
  margin: 0;
  height: 100%;
}
/* begin: toolbar hyperlink */

.tlb-nav-link {
  display: table;
  height: 54px;
  float: left;
  margin-left: 16px;
}
.tlb-nav-link div {
  display: table-cell;
  vertical-align: middle;
  padding-right: 10px;
}
.tlb-nav-link a {
  display: block;
  font-size: 12px;
  color: #2271E7;
  text-decoration: none;
}
.tlb-nav-link a:hover {
  color: #F16A22;
}
.tlb-nav-button {
  float: left;
  margin-top: 16px;
  margin-left: 10px;
}
.tlb-nav-button div {
  vertical-align: middle;
  padding-right: 10px;
}
.tlb-nav-button a {
  background-color: #94A1C1;
  -webkit-border-radius: 4px;
  -moz-border-radius: 3px;
  border-radius: 4px;
  padding: 3px 14px;
  display: inline-block;
  font-size: .8em;
  color: white;
  height: 100%;
  font-family: arial;
  margin-left: 5px;
  text-decoration: none;
}
.tlb-nav-button a:hover {
  background-color: #697cac;
  text-decoration: underline;
}
/* end: toolbar hyperlink */

.ui-widget-content {
  border: 1px solid #A0A0A0;
  background: #FFFFFF !important;
}
/* Styles needed by SpreadsheetConverter */

*.ee100 {
  color: black;
  font-family: Calibri, sans-serif;
  font-size: 11.00pt;
  font-style: normal;
  font-weight: 400;
  padding-left: 1px;
  padding-right: 1px;
  padding-top: 1px;
  text-align: left;
  vertical-align: bottom
}
*.ee103 {
  border-bottom: 0.75pt solid windowtext;
  color: black;
  font-family: Calibri, sans-serif;
  font-size: 11.00pt;
  font-style: normal;
  font-weight: 400;
  padding-left: 1px;
  padding-right: 1px;
  padding-top: 1px;
  text-align: left;
  vertical-align: bottom
}
*.ee107 {
  border: 0.75pt solid windowtext;
  color: black;
  font-family: Calibri, sans-serif;
  font-size: 11.00pt;
  font-style: normal;
  font-weight: 400;
  padding-left: 1px;
  padding-right: 1px;
  padding-top: 1px;
  text-align: left;
  vertical-align: bottom
}
*.ee108 {
  border-left: 0.75pt solid windowtext;
  border-top: 0.75pt solid windowtext;
  color: black;
  font-family: Calibri, sans-serif;
  font-size: 11.00pt;
  font-style: normal;
  font-weight: 400;
  padding-left: 1px;
  padding-right: 1px;
  padding-top: 1px;
  text-align: right;
  vertical-align: bottom
}
*.ee111 {
  border-top: 0.75pt solid windowtext;
  color: black;
  font-family: Calibri, sans-serif;
  font-size: 11.00pt;
  font-style: normal;
  font-weight: 400;
  padding-left: 1px;
  padding-right: 1px;
  padding-top: 1px;
  text-align: right;
  vertical-align: bottom
}
*.ee112 {
  border-left: 1.50pt solid windowtext;
  border-top: 1.50pt solid windowtext;
  color: black;
  font-family: Calibri, sans-serif;
  font-size: 11.00pt;
  font-style: normal;
  font-weight: 400;
  padding-left: 1px;
  padding-right: 1px;
  padding-top: 1px;
  text-align: right;
  vertical-align: bottom
}
*.ee113 {
  border-right: 1.50pt solid windowtext;
  border-top: 1.50pt solid windowtext;
  color: black;
  font-family: Calibri, sans-serif;
  font-size: 11.00pt;
  font-style: normal;
  font-weight: 400;
  padding-left: 1px;
  padding-right: 1px;
  padding-top: 1px;
  text-align: right;
  vertical-align: bottom
}
*.ee114 {
  border-bottom: 0.75pt solid windowtext;
  border-left: 0.75pt solid windowtext;
  color: black;
  font-family: Calibri, sans-serif;
  font-size: 11.00pt;
  font-style: normal;
  font-weight: 400;
  padding-left: 1px;
  padding-right: 1px;
  padding-top: 1px;
  text-align: right;
  vertical-align: bottom
}
*.ee115 {
  border-bottom: 0.75pt solid windowtext;
  color: black;
  font-family: Calibri, sans-serif;
  font-size: 11.00pt;
  font-style: normal;
  font-weight: 400;
  padding-left: 1px;
  padding-right: 1px;
  padding-top: 1px;
  text-align: right;
  vertical-align: bottom
}
*.ee116 {
  border-bottom: 1.50pt solid windowtext;
  border-left: 1.50pt solid windowtext;
  color: black;
  font-family: Calibri, sans-serif;
  font-size: 11.00pt;
  font-style: normal;
  font-weight: 400;
  padding-left: 1px;
  padding-right: 1px;
  padding-top: 1px;
  text-align: right;
  vertical-align: bottom
}
*.ee117 {
  border-bottom: 1.50pt solid windowtext;
  border-right: 1.50pt solid windowtext;
  color: black;
  font-family: Calibri, sans-serif;
  font-size: 11.00pt;
  font-style: normal;
  font-weight: 400;
  padding-left: 1px;
  padding-right: 1px;
  padding-top: 1px;
  text-align: right;
  vertical-align: bottom
}
*.ee118 {
  border-bottom: 1.50pt solid windowtext;
  color: black;
  font-family: Calibri, sans-serif;
  font-size: 11.00pt;
  font-style: normal;
  font-weight: 400;
  padding-left: 1px;
  padding-right: 1px;
  padding-top: 1px;
  text-align: left;
  vertical-align: bottom
}
*.ee119 {
  border-left: 1.50pt solid windowtext;
  border-top: 1.50pt solid windowtext;
  color: black;
  font-family: Calibri, sans-serif;
  font-size: 11.00pt;
  font-style: normal;
  font-weight: 400;
  padding-left: 1px;
  padding-right: 1px;
  padding-top: 1px;
  text-align: left;
  vertical-align: bottom
}
*.ee120 {
  border-right: 1.50pt solid windowtext;
  border-top: 1.50pt solid windowtext;
  color: black;
  font-family: Calibri, sans-serif;
  font-size: 11.00pt;
  font-style: normal;
  font-weight: 400;
  padding-left: 1px;
  padding-right: 1px;
  padding-top: 1px;
  text-align: left;
  vertical-align: bottom
}
*.ee121 {
  border-bottom: 1.50pt solid windowtext;
  border-top: 1.50pt solid windowtext;
  color: black;
  font-family: Calibri, sans-serif;
  font-size: 11.00pt;
  font-style: normal;
  font-weight: 400;
  padding-left: 1px;
  padding-right: 1px;
  padding-top: 1px;
  text-align: center;
  vertical-align: bottom;
  position: absolute;
  margin-top: -2px;
  width: 189px;
}
*.ee124 {
  border-bottom: 1.50pt solid windowtext;
  border-left: 1.50pt solid windowtext;
  color: black;
  font-family: Calibri, sans-serif;
  font-size: 11.00pt;
  font-style: normal;
  font-weight: 400;
  padding-left: 1px;
  padding-right: 1px;
  padding-top: 1px;
  text-align: left;
  vertical-align: bottom
}
*.ee125 {
  border-bottom: 1.50pt solid windowtext;
  border-right: 1.50pt solid windowtext;
  color: black;
  font-family: Calibri, sans-serif;
  font-size: 11.00pt;
  font-style: normal;
  font-weight: 400;
  padding-left: 1px;
  padding-right: 1px;
  padding-top: 1px;
  text-align: left;
  vertical-align: bottom
}
*.ee126 {
  border-bottom: 1.50pt solid windowtext;
  border-left: 1.50pt solid windowtext;
  border-right: 1.50pt solid black;
  border-top: 1.50pt solid windowtext;
  color: black;
  font-family: Calibri, sans-serif;
  font-size: 11.00pt;
  font-style: normal;
  font-weight: 400;
  padding-left: 1px;
  padding-right: 1px;
  padding-top: 1px;
  text-align: center;
  vertical-align: bottom;
  position: absolute;
  width: 186px;
}
textarea {
  overflow: auto;
}
<form id='formc' name='formc' method='post' action='http://www.spreadsheetserver.com/server1/g/submit/submit.aspx' target='_top'>
  <div id='tab'>
    <div id='sheet-2' style='padding: 0em 1.4em;'>
      <table width='512' cellspacing='1' cellpadding='0' style='border-spacing:1; border-collapse:collapse;' onkeydown='javascript:navigate(event);'>
        <col width='64' />
        <col width='64' />
        <col width='64' />
        <col width='64' />
        <col width='64' />
        <col width='64' />
        <col width='64' />
        <col width='64' />
        <tr style='height:15pt'>
          <td class='ee100' style='height:15pt;'>&nbsp;</td>
          <td class='ee100' style='height:15pt;'>&nbsp;</td>
          <td class='ee100' style='height:15pt;'>&nbsp;</td>
          <td class='ee100' style='height:15pt;'>&nbsp;</td>
          <td class='ee100' style='height:15pt;'>&nbsp;</td>
          <td class='ee100' style='height:15pt;'>&nbsp;</td>
          <td class='ee100' style='height:15pt;'>&nbsp;</td>
          <td class='ee100' style='height:15pt;'>&nbsp;</td>
        </tr>
        <tr style='height:15pt'>
          <td class='ee100' style='height:15pt;'>&nbsp;</td>
          <td class='ee103' style='height:15pt;'>
            single
          </td>
          <td class='ee100' style='height:15pt;' colspan='6'>&nbsp;</td>
        </tr>
        <tr style='height:16pt'>
          <td class='ee100' style='height:16pt;' colspan='8'>&nbsp;</td>
        </tr>
        <tr style='height:15pt'>
          <td class='ee100' style='height:15pt;'>&nbsp;</td>
          <td class='ee107' style='height:15pt;'>
            a
          </td>
          <td class='ee107' style='height:15pt;'>
            b
          </td>
          <td class='ee100' style='height:15pt;'>&nbsp;</td>
          <td class='ee108' style='height:15pt;'>
            1
          </td>
          <td class='ee111' style='height:15pt;'>
            2
          </td>
          <td class='ee112' style='height:15pt;'>
            3
          </td>
          <td class='ee113' style='height:15pt;'>
            4
          </td>
        </tr>
        <tr style='height:16pt'>
          <td class='ee100' style='height:16pt;'>&nbsp;</td>
          <td class='ee107' style='height:16pt;'>
            c
          </td>
          <td class='ee107' style='height:16pt;'>
            d
          </td>
          <td class='ee100' style='height:16pt;'>&nbsp;</td>
          <td class='ee114' style='height:16pt;'>
            5
          </td>
          <td class='ee115' style='height:16pt;'>
            6
          </td>
          <td class='ee116' style='height:16pt;'>
            7
          </td>
          <td class='ee117' style='height:16pt;'>
            8
          </td>
        </tr>
        <tr style='height:15pt'>
          <td class='ee100' style='height:15pt;' colspan='8'>&nbsp;</td>
        </tr>
        <tr style='height:16pt'>
          <td class='ee100' style='height:16pt;' colspan='4'>&nbsp;</td>
          <td class='ee118' style='height:16pt;'>&nbsp;</td>
          <td class='ee118' style='height:16pt;'>&nbsp;</td>
          <td class='ee118' style='height:16pt;'>&nbsp;</td>
          <td class='ee100' style='height:16pt;'>&nbsp;</td>
        </tr>
        <tr style='height:16pt'>
          <td class='ee100' style='height:16pt;'>&nbsp;</td>
          <td class='ee119' style='height:16pt;'>
            e
          </td>
          <td class='ee120' style='height:16pt;'>
            f
          </td>
          <td class='ee100' style='height:16pt;'>&nbsp;</td>
          <td class='ee121' style='height:16pt;' colspan='3'>
            t
          </td>
          <td class='ee100' style='height:16pt;'>&nbsp;</td>
        </tr>
        <tr style='height:16pt'>
          <td class='ee100' style='height:16pt;'>&nbsp;</td>
          <td class='ee124' style='height:16pt;'>
            g
          </td>
          <td class='ee125' style='height:16pt;'>
            h
          </td>
          <td class='ee100' style='height:16pt;' colspan='2'>&nbsp;</td>
          <td class='ee126' style='height:16pt;' colspan='3'>
            j
          </td>
        </tr>
      </table>
    </div>
  </div>
</form>
<div class='toolbar no-print'>
  <div class='tlb-elm toolpanel'>
    <button class='tlb-btn toolbarBluebtn update'>Update</button>
    <button class='tlb-btn toolbarBluebtn reset' style='margin-left:3px'>Reset</button>
    <button class='tlb-btn toolbarBluebtn print' style='margin-left:3px'>Print</button>
    <button class='tlb-btn toolbarGreenbtn submit' style='margin-left:12px'>Submit</button>
  </div>
</div>

仅此而已,它应该对您有用,如果您有任何问题,请告诉我。

于 2015-06-19T14:43:54.143 回答