2014-06-18 29 views
0

是否有方法使用現有類將現有6行錶轉換爲2行和3列。我沒有訪問html文件。只能添加樣式到現有的類使用現有類將表6行轉換爲2行和3列

<table cellspacing="0"> 
     <tbody><tr> 
       <td class="class1"><label for="radio0"> 
       <input type="radio" checked="" value="1" name="name" id="radio0">1 
       </label></td> 
      </tr> 
     <tr> 
       <td class="class2"><label for="radio1"> 
       <input type="radio" value="8" name="name" id="radio1">2 
       </label></td> 
      </tr> 
     <tr> 
       <td class="class3"><label for="radio2"> 
       <input type="radio" value="12" name="name" id="radio2">3 
       </label></td> 
      </tr> 
     <tr> 
       <td class="class4"><label for="radio3"> 
       <input type="radio" value="4" name="name" id="radio3">4 
       </label></td> 
      </tr> 
     <tr> 
       <td class="class5"><label for="radio4"> 
       <input type="radio" value="7" name="name" id="radio4">5 
       </label></td> 
      </tr> 
     <tr> 
       <td class="class6"><label for="radio5"> 
       <input type="radio" value="5" name="name" id="radio5">6 
       </label></td> 
      </tr> 

     </tbody></table> 
+0

我認爲你必須使用JS來解決這個問題。 –

回答

0

你總是可以定位的元素是絕對的,但我要提醒你,它可能無法保持一致。而這僅僅是改變CSS以及。這個例子是here

CSS:

.class3{ 
    position:absolute; 
     margin-left: 40px; 
    top: 9px; 
} 
.class4{ 
    position:absolute; 
    margin-left: 40px; 
    top: 30px; 
} 
.class5{ 
    position:absolute; 
     margin-left: 80px; 
    top: 9px; 
} 
.class6{ 
    position:absolute; 
    margin-left: 80px; 
    top: 30px; 
} 
+0

非常感謝..這將工作 – user3752575

+0

請檢查我的答案是正確的答案,請! – BuddhistBeast

+0

我也很高興它工作:)如果您有任何訪問權限,您可能會發現JS解決方案將更好地爲未來工作! – BuddhistBeast