2011-03-09 35 views
0

這是我在FireFox中的表。請注意,使用用戶名的中間欄寬,編輯鏈接右對齊。CSS表td寬度和右對齊不工作

enter image description here

這是IE7和IE8:

enter image description here

這裏是HTML:

<fieldset > 
    <legend>Account Information</legend> 
    <table class="display-table"> 
     <tr> 
      <td class="display-label"> 
       <label for="UserName">Username</label> 
      </td> 
      <td class="display-field-middle"> 
       user7 
      </td> 
      <td class="display-field-right"> 
       <a class="" href="/test1/Account/ChangeUserName">edit</a> 


      </td> 
     </tr> 
     <tr> 
      <td class="display-label"> 
       <label for="Password">Password</label> 
      </td> 
      <td class="display-field-middle"> 
       ********* 
      </td> 
      <td class="display-field-right"> 
       <a class="" href="/test1/Account/ChangePassword">edit</a> 
      </td> 
     </tr> 
    </table> 
    </fieldset> 

這是繼承的樣式螢火顯示:

enter image description here

這裏是樣式表:

.display-table 
{ 
    border-collapse:collapse; 
    width: 400px; 
} 

.display-label 
{ 
    white-space: nowrap; 
    vertical-align:middle; 
    width: 120px; 
} 

.display-field-middle 
{ 
    width: 200px; 
    background-color: #dfeffc; 
    vertical-align:middle; 
    height: 30px; 
    padding-left: 5px; 
    padding-right: 5px; 
} 


.display-field-right 
{ 
    width: 50px; 
    background-color: #dfeffc; 
    vertical-align:middle; 
    height: 30px; 
    padding-left: 5px; 
    padding-right: 5px; 
    text-align: right; 
} 

爲什麼不是中柱擴大,你爲什麼不編輯鏈接右對齊? 我嘗試了一切!

+0

在這裏工作在FF/IE8/IE7:http://jsfiddle.net/thirtydot/C4Qbx/ - 所以我不認爲你的問題尚未擁有所有解決這個問題所需的信息 – thirtydot

+0

你有什麼。例如:* {text-align:left;} - 或 - td {text-align:left;} – Sam

+0

我忘記了小提琴,謝謝,我更新了我的問題以顯示繼承的風格。 – rboarman

回答

0

事實證明,我測試不正確,頁面一直在工作。 :(