2012-07-29 62 views
1

我無法讓內部表格顯示邊框。css border-collapse無法應用

在下面的html中,它是表<table class="billing_history" id="billing_history0" >。我希望表最終只有行的頂部和底部邊界,但我無法讓它工作。事實上,我似乎無法獲得很多邊界屬性來應用於表格。特別是,我嘗試在css中設置border-collapse: collapse;,但這不適用於內部表格。但是,如果我在表格中設置了樣式標籤(即style="border-collapse: collapse;"),它會工作。因此,出於某種原因,css中的border-collapse: collapse;不適用於內部表格,而其他屬性(即font-size: 11px;)正在應用。

任何人有任何想法? HTML和CSS下面...

我很欣賞你們可能有的任何建議!

HTML:

<table id="bill-list"> 
<thead> 
    <tr> 
      <th>Service Date</th> 
      <th>Time</th> 
      <th>Patient Name</th> 
      <th>Remarks</th> 
      <th>Notes</th> 
      <th>Service Description</th> 
      <th>COMMENTS</th> 
    </tr> 
</thead> 
<tbody> 
      <tr id="bill0" class="no-bills" onclick="showBillDetails(0); setFocusOnFirstInputField(0);"> 
        <td class="no-bills">2009-03-03&nbsp;</td> 
        <td class="no-bills">09:45:00&nbsp;</td> 
        <td class="no-bills">bob</td> 
        <td class="no-bills">asdfasdf</td> 
        <td class="no-bills">asdfasdf</td> 
        <td class="no-bills">asdfasdf</td> 
        <td class="no-bills">blahblah</td> 

      </tr> 
      <tr id="bill"> 
       <td id="bill_details0" style="display:;" colspan=7> 
        <span onclick="addBillingItem(0)" style="color:blue;">Add Item</span>   
        <table> 
         <thead> 
          <tr> 
           <td></td> 
           <td>Billing Code</td> 
           <td>Amount</td> 
           <td>Units</td> 
           <td>Dx Code</td> 
           <td>Dx Description</td> 
           <td>Total</td> 
           <td>SLI Code</td> 
          </tr> 
         <thead> 
         <tbody id="billing_items0"> 
           <tr id="billing_item0_0"> 
            <td onclick="deleteBillingItem(0, 0)" style="color:blue;">X</td> 
            <td> <input type="text" size="6" name="bill_code0[]" onkeydown="if (isMoveBetweenBills(event)) { moveBetweenBills(event, 0); }" /> </td> 
            <td> <input type="text" size="6" name="amount0[]" onkeydown="if (isMoveBetweenBills(event)) { moveBetweenBills(event, 0); }" /> </td> 

            <td> <input type="text" size="3" name="units0[]" onkeydown="if (isMoveBetweenBills(event)) { moveBetweenBills(event, 0); }" /> </td> 
            <td> <input type="text" size="6" name="dx_code0[]" onkeydown="if (isMoveBetweenBills(event)) { moveBetweenBills(event, 0); }" /> </td> 
            <td> <input type="text" size="12" name="dx_desc0[]" onkeydown="if (isMoveBetweenBills(event)) { moveBetweenBills(event, 0); }" /> </td> 
            <td> <input type="text" size="6" name="total0[]" onkeydown="if (isTabKey(event) && checkIfLastBillingItem(0, 0)) { addBillingItem(0); } else if (isEnterKey(event)) { submitBill(0); } return true;" /> </td> 
            <td> <input type="text" size="6" name="sli_code0[]" /> </td> 

           </tr> 

         </tbody> 
        </table> 
        <span id="more_details_button0" onclick="showMoreDetails(0, 34601,); " style="color:blue;">more</span> 
        <table class="more_details"> 
         <tr> 
          <td> 
           <table class="billing_history" id="billing_history0" > 
           <tbody><tr><td>1234</td><td>2012-01-01</td><td>09:00:00</td><td>0.00</td><td>0.00</td><td>n/a</td></tr><tr><td>1234</td><td>0.00</td><td>1</td><td>1</td><td>----</td><td>0.00</td></tr><tr><td>1234</td><td>0.00</td><td>1</td><td>1</td><td>blah blah</td><td>0.00</td></tr></tbody> 
           </table> 

          </td> 
          <td> 
           <table id="appointment_notes0" > 
           </table> 
          </td> 
         </tr> 
        </table> 
       </td> 
      </tr> 
</tbody> 
</table> 

CSS:

.search_details 
{ 
    font-family: "Lucida Sans Unicode", "Lucida Grande", Sans-Serif; 
    font-size: 12px; 
    margin: 10px; 
    width: 60%; 
    text-align: left; 
    border-collapse: collapse; 
} 

#bill-list 
{ 
    font-family: "Lucida Sans Unicode", "Lucida Grande", Sans-Serif; 
    font-size: 12px; 
    /*margin: 45px;*/ 
    width: 100%; 
    text-align: left; 
    border-collapse: collapse; 
} 
#bill-list th 
{ 
    font-size: 13px; 
    font-weight: normal; 
    padding: 8px; 
    background: #b9c9fe; 
    border-top: 4px solid #aabcfe; 
    border-bottom: 1px solid #fff; 
    color: #039; 
} 
#bill-list td 
{ 
    padding: 8px; 
    background: #e8edff; 
    border-bottom: 1px solid #fff; 
    color: #669; 
    font-weight: normal; 
    border-top: 1px solid transparent; 
} 
#bill-list tr:hover td 
{ 
    background: #d0dafd; 
    color: #339; 
    font-weight: normal; 
} 

#bill-list #bill td 
{ 
    background: white; 
} 

#bill-list .no-bills 
{ 
    background: #e8edff; 
    color: red; 
    font-weight: bold; 

} 
#bill-list tr:hover .no-bills 
{ 
    background: #d0dafd; 
    color: red; 
    font-weight: bold; 
} 


#bill-list #bill .more_details tr td 
{ 
    background: #e8edff; 
    border: none; 
} 

#bill-list #bill .billing_history tr td 
{ 
    background: red; 
    border: none; 
    border-top: 10px solid transparent; 
    border-bottom: 10px solid #fff; 

    font-size: 11px; 
    padding: 1px; 

    text-decoration:none; 
    border-style:none; 
    border:none; 
    outline:none; 
    border-collapse: collapse; 
} 
+0

我在這裏沒有看到任何邊界。在你的HTML你沒有包括錯字或你沒有他們在你的網頁? http://jsfiddle.net/DDkMX/ – peteroak 2012-07-29 03:18:13

+0

哎呀抱歉,我忘了他們在複製/粘貼 – Jarrett 2012-07-29 03:21:22

回答

3

如何在

#bill-list #bill table 

邊界崩潰設定邊界崩潰只適用於表,而不是TD,根據mozilla doco

+0

就像一個魅力工作,謝謝丹!另外,對於mozilla doco並沒有太多的瞭解,我可能不得不更多地關注這一點。 乾杯 – Jarrett 2012-07-29 03:31:51

+0

沒有probs,很高興它有幫助。 Mozilla doco是**炸彈** - 參考doco是一流的,導遊通常都很棒。 – 2012-07-29 03:35:01