2014-09-28 108 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)