title: freezed header width is changing
body: <p>I have below code for freezing the header on top:</p>
  
  <pre><code>var div = $('#header1');
           var start = $("#header1").offset().top;
           $.event.add(window, "scroll", function() {
           var p = $(window).scrollTop();
           $("#header1").css('position',((p)&gt;start) ? 'fixed' : 'static');
           $("#header1").css('top',((p)&gt;start) ? '0px' : '');
  
           });
  </code></pre>
  
  <p>where <code>header1</code> is the id of <code>thead</code> but as soon as header starts freezing at top while scrolling, its width changes and also of table's first column</p>
  
  <p>HTML code:</p>
  
  <pre><code>    &lt;table id="mytable" summary="Contains" class="table-stripes timetable-stops-table"&gt;
              &lt;thead id="header1" width="100%"&gt;
                  &lt;tr scope="colgroup" colspan="1"&gt;
                      &lt;th&gt;1&lt;a class="js-toggle-all-stops"&gt;+ show all stops&lt;/a&gt;&lt;/th&gt; 
                      &lt;th &gt;2&lt;span class="visuallyhidden"&gt;Depart&lt;/span&gt;&lt;/th&gt;
                      &lt;th&gt;3&lt;span class="visuallyhidden"&gt;Depart&lt;/span&gt;th&gt;
                      &lt;th &gt;4&lt;span class="visuallyhidden"&gt;Depart&lt;/span&gt;&lt;/th&gt;
                      &lt;th &gt;5&lt;span class="visuallyhidden"&gt;Depart&lt;/span&gt;th&gt;
                      &lt;th &gt;6&lt;span class="visuallyhidden"&gt;Depart&lt;/span&gt;&lt;/th&gt;
                      &lt;th &gt;7&lt;span class="visuallyhidden"&gt;Depart&lt;/span&gt;&lt;/th&gt;
                      &lt;th &gt;8&lt;span class="visuallyhidden"&gt;Depart&lt;/span&gt;
                                                  &lt;span class="alert-icon"&gt;&lt;img src="inverted.png" alt="Alert message" class="js-alert-icon"&gt;&lt;span class="alert-icon message js-alert"&gt;&lt;span class="indicator"&gt;&lt;/span&gt;Delays&lt;/span&gt;&lt;/span&gt;
                      &lt;/th&gt;
                      &lt;th &gt;9&lt;span class="visuallyhidden"&gt;Depart&lt;/span&gt;&lt;/th&gt;
                      &lt;th &gt;10&lt;span class="visuallyhidden"&gt;Depart&lt;/span&gt;&lt;/th&gt;
                      &lt;th &gt;11&lt;span class="visuallyhidden"&gt;Depart&lt;/span&gt;&lt;/th&gt;
                      &lt;th &gt;12&lt;span class="visuallyhidden"&gt;Depart&lt;/span&gt;&lt;/th&gt;
                      &lt;th &gt;13&lt;span class="visuallyhidden"&gt;Depart&lt;/span&gt;&lt;/th&gt;
                      &lt;th &gt;14&lt;span class="visuallyhidden"&gt;Depart&lt;/span&gt;&lt;/th&gt;
                      &lt;th &gt;15&lt;span class="visuallyhidden"&gt;Depart&lt;/span&gt;&lt;/th&gt;
                      &lt;th &gt;16&lt;span class="visuallyhidden"&gt;Depart&lt;/span&gt;&lt;/th&gt;
                      &lt;th &gt;17&lt;span class="visuallyhidden"&gt;Depart&lt;/span&gt;&lt;/th&gt;
                      &lt;th &gt;18&lt;span class="visuallyhidden"&gt;Depart&lt;/span&gt;&lt;/th&gt;
                      &lt;th &gt;19&lt;span class="visuallyhidden"&gt;Depart&lt;/span&gt;&lt;/th&gt;
                      &lt;th &gt;20&lt;span class="visuallyhidden"&gt;Depart&lt;/span&gt;&lt;/th&gt;
                      &lt;th &gt;21&lt;span class="visuallyhidden"&gt;Depart&lt;/span&gt;&lt;/th&gt;
                      &lt;th &gt;22&lt;span class="visuallyhidden"&gt;Depart&lt;/span&gt;&lt;/th&gt;
                      &lt;th &gt;23&lt;span class="visuallyhidden"&gt;Depart&lt;/span&gt;&lt;/th&gt;
                      &lt;th &gt;24&lt;span class="visuallyhidden"&gt;Depart&lt;/span&gt;&lt;/th&gt;
                      &lt;th &gt;25&lt;span class="visuallyhidden"&gt;Depart&lt;/span&gt;&lt;/th&gt;
                      &lt;th &gt;26&lt;span class="visuallyhidden"&gt;Depart&lt;/span&gt;&lt;/th&gt;
                      &lt;th &gt;27&lt;span class="visuallyhidden"&gt;Depart&lt;/span&gt;&lt;/th&gt;
                      &lt;th &gt;28&lt;span class="visuallyhidden"&gt;Depart&lt;/span&gt;&lt;/th&gt;
                      &lt;th &gt;29&lt;span class="visuallyhidden"&gt;Depart&lt;/span&gt;&lt;/th&gt;
                  &lt;/tr&gt;
              &lt;/thead&gt;
              &lt;tbody class="stop-odd"&gt;
                  &lt;tr class="stop stop-major stop-major-odd js-stop-major"&gt;
                      &lt;th&gt;
                          &lt;span class="stop-name"&gt;Ocean Road&lt;/span&gt;,
                          &lt;span class="stop-loc"&gt;Beach&lt;/span&gt;
                          &lt;div class="stop-wrap"&gt;
                              &lt;span class="stop-no"&gt;Stop no&lt;br&gt;&lt;a href="#"&gt;210825&lt;/a&gt;&lt;/span&gt;
                              &lt;span class="stop-expand"&gt;&lt;a href="javascript:void(0);" class="js-toggle-stops"&gt;+ 1 stop&lt;/a&gt;&lt;/span&gt;
                          &lt;/div&gt;
                      &lt;/th&gt;
                      &lt;td&gt;…&lt;/td&gt;
                      &lt;td&gt;…&lt;/td&gt;
                      &lt;td&gt;…&lt;/td&gt;
                      &lt;td&gt;…&lt;/td&gt;
                      &lt;td&gt;11:05 &lt;span class="alert-icon"&gt;&lt;img src="icon-alert.png" alt="Alert message" class="js-alert-icon"&gt;&lt;span class="alert-icon message js-alert"&gt;&lt;span class="indicator"&gt;&lt;/span&gt;Delays&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;
                      &lt;td&gt;…&lt;/td&gt;
                      &lt;td&gt;11:07&lt;/td&gt;
                      &lt;td&gt;11:09&lt;/td&gt;
                      &lt;td&gt;11:12&lt;/td&gt;
                      &lt;td&gt;11:35&lt;/td&gt;
                      &lt;td&gt;11:47&lt;/td&gt;
                      &lt;td class="next-day"&gt;00:05&lt;/td&gt;
                      &lt;td class="next-day"&gt;00:07 &lt;span class="alert-icon"&gt;&lt;img src="alert.png" alt="Alert message" class="js-alert-icon"&gt;&lt;span class="alert-icon message js-alert"&gt;&lt;span class="indicator"&gt;&lt;/span&gt;Delays&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;
                      &lt;td&gt;…&lt;/td&gt;
                      &lt;td&gt;06:09&lt;/td&gt;
                      &lt;td&gt;11:12&lt;/td&gt;
                      &lt;td&gt;11:35&lt;/td&gt;
                      &lt;td&gt;11:47&lt;/td&gt;
                      &lt;td&gt;11:07&lt;/td&gt;
                      &lt;td&gt;11:09&lt;/td&gt;
                      &lt;td&gt;11:12&lt;/td&gt;
                      &lt;td&gt;11:35&lt;/td&gt;
                      &lt;td&gt;11:47&lt;/td&gt;
                      &lt;td&gt;11:07&lt;/td&gt;
                      &lt;td&gt;11:09&lt;/td&gt;
                      &lt;td&gt;11:12&lt;/td&gt;
                      &lt;td&gt;06:35&lt;/td&gt;
                      &lt;td&gt;11:47&lt;/td&gt;
                  &lt;/tr&gt;
  &lt;tbody&gt;
  &lt;/table&gt;
  </code></pre>