2014-09-28 45 views
-2

我在格式化表格時遇到問題。出於某種原因,colspans和rowspans不起作用,單元格被放入可用的第一行和第一列。我已經創建了列組,用於指定列的寬度。我的代碼在這裏:html表格格式行和列

<table class = 「programs」 border=「1」 
    summary=「Lists the morning programs aired by KPAF from 5:00 a.m. to 12:00p.m.(central time).> 
<caption> All Times Central </caption> 
<colgroup> 
    <col class = 「timeColumn」 /> 
    <col class = 「wDayColumns」 span =「5」/> 
    <col class = 「wEndColumns」 span=「2」/> 
</colgroup> 

    <thead> 

     <th>Time</th> 
     <th>Monday</th> 
     <th>Tuesday</th> 
     <th>Wednesday</th> 
     <th>Thursday</th> 
     <th>Friday</th> 
     <th>Saturday</th> 
     <th>Sunday</th> 

    </thead> 

    <tbody> 

     <tr> 
      <th>5:00</th> 
      <td colspan =「5」 rowspan=「4」>Dawn Air</td> 
      <td colspan =「1」>Dawn Air Weekends</td> 
      <td colspan =「1」>Sunday Magazine</td> 

     </tr> 
     <tr> 
      <th>5:30</th> 

     </tr> 
     <tr> 
      <th>6:00</th> 
      <td col = 「1」 rowspan = 「2」>Weekend Reflections</td> 
     </tr> 
     <tr> 
     <th>6:30</th> 
     </tr> 
     <tr> 
      <th>7:00</th> 
      <td colspan=「5」> Local News</td> 
      <td colspan=「1」 rowspan=「2」>Weekend Wrap</td> 
      <td colspan=「1」 rowspan=「2」>Radio U</td> 

     </tr> 
     <tr> 
      <th>7:30</th> 
      <td colspan=「5」>World News Feed</td> 
     </tr> 
     <tr> 
     <th>8:00</th> 
      <td colspan=「5」 rowspan=「4」>Classical Roots</td> 
      <td colspan=「1」 rowspan=「3」>What can you say?</td> 
      <td colspan=「1」 rowspan=「4」>University on the air</td> 
     </tr> 
     <tr> 
     <th>8:30</th> 
     </tr> 
     <tr> 
     <th>9:00</th> 
     </tr> 
     <tr> 
     <th>9:30</th> 
      <td colspan=「1」 rowspan=「4」>Animal Talk</td> 
     </tr> 
     <tr> 
     <th>10:00</th> 
      <td colspan=「5」 rowspan=「4」>Symphony City</td> 
      <td colspan=「1」 rowspan=「1」>Word Play</td> 
     </tr> 
     <tr> 
     <th>10:30</th> 
      <td colspan=「1」 rowspan=「1」>Brain Stew</td> 
     </tr> 
     <tr> 
     <th>11:00</th> 
      <td colspan=「1」 rowspan=「3」>Opera Live from the East Coast</td> 
      <td colspan=「1」 rowspan=「1」>The Inner Mind</td> 
     </tr> 
     <tr> 
     <th>11:30</th> 
      <td colspan=「1」 rowspan=「1」> Grammar Rules!!</td> 
     </tr> 
     <tr> 
     <th>12:00</th> 
      <td colspan=「5」 rowspan=「1」>Book Club</td> 
      <td colspan=「1」 rowspan=「1」>Weekend Wrap</td> 
     </tr> 
    </tbody> 



</table> 
+0

您正在使用錯誤的引號!! ..您需要使用單引號或雙引號.. – PSL 2014-09-28 22:16:23

+0

請提供更多信息請問究竟出了什麼問題?當我在[JSFiddle](http://jsfiddle.net/WW3bh/19603/)中運行你的代碼時,似乎他們正在正確地計算出它們的寬度,但我並不完全理解你的問題。 – Aeolingamenfel 2014-09-28 22:18:00

回答

0

這是因爲您使用的是壞引號「,」。您必須使用正常的「(ASCII碼:034)