Note that there are some explanatory texts on larger screens.

plurals
  1. POAlign table headers to the rows
    primarykey
    data
    text
    <p>I am trying to create table with <strong>fixed row headers</strong> (so during scrolling the column heading stay) , I have been able to achieve that <strong>but now the table headers are not aligned</strong> to the rows below. I have also created a <a href="http://jsfiddle.net/PmmPJ/" rel="nofollow noreferrer"><strong>jsfiddle</strong></a> for that. Currently the output is like:</p> <p><img src="https://i.stack.imgur.com/8nkhs.png" alt="enter image description here"></p> <p>Here is the sample extracted HTML. </p> <pre><code>&lt;head&gt; &lt;style&gt; table { /*background-color: #aaa;*/ width: 800px; } tbody { /*background-color: #ddd;*/ height: 200px; width: 800px; overflow: auto; } td { } thead &gt; tr, tbody { display: block; } &lt;/style&gt; &lt;/head&gt; &lt;body&gt; &lt;div id="containerdiv" style="width: 800px"&gt; &lt;table id="dynamictable"&gt; &lt;thead&gt; &lt;tr&gt; &lt;th&gt; ID &lt;/th&gt; &lt;th&gt; Title &lt;/th&gt; &lt;th&gt; Media Title &lt;/th&gt; &lt;th&gt; Broadcast Time &lt;/th&gt; &lt;th&gt; Destination &lt;/th&gt; &lt;th&gt; Channel &lt;/th&gt; &lt;th&gt; Start Time &lt;/th&gt; &lt;th&gt; End Time &lt;/th&gt; &lt;/tr&gt; &lt;/thead&gt; &lt;tbody id="tablebody"&gt; &lt;tr id="0"&gt; &lt;td&gt; ID: 0 &lt;/td&gt; &lt;td&gt; Some Content &lt;/td&gt; &lt;td&gt; Some more contents &lt;/td&gt; &lt;td&gt; Some more contents contents contents &lt;/td&gt; &lt;td&gt; Some more contents contents contents &lt;/td&gt; &lt;td&gt; Some more contents contents contents &lt;/td&gt; &lt;td&gt; Some more contents contents contents &lt;/td&gt; &lt;td&gt; Some more contents contents contents &lt;/td&gt; &lt;/tr&gt; &lt;tr id="1"&gt; &lt;td &gt; ID: 1 &lt;/td&gt; &lt;td&gt; Some Content &lt;/td&gt; &lt;td&gt; Some more contents &lt;/td&gt; &lt;td&gt; Some more contents contents contents &lt;/td&gt; &lt;td&gt; Some more contents contents contents &lt;/td&gt; &lt;td&gt; Some more contents contents contents &lt;/td&gt; &lt;td&gt; Some more contents contents contents &lt;/td&gt; &lt;td&gt; Some more contents contents contents &lt;/td&gt; &lt;/tr&gt; &lt;tr id="Tr1"&gt; &lt;td&gt; ID: 1 &lt;/td&gt; &lt;td&gt; Some Content &lt;/td&gt; &lt;td&gt; Some more contents &lt;/td&gt; &lt;td&gt; Some more contents contents contents &lt;/td&gt; &lt;td&gt; Some more contents contents contents &lt;/td&gt; &lt;td&gt; Some more contents contents contents &lt;/td&gt; &lt;td&gt; Some more contents contents contents &lt;/td&gt; &lt;td&gt; Some more contents contents contents &lt;/td&gt; &lt;/tr&gt; &lt;/tbody&gt; &lt;/table&gt; &lt;/div&gt; &lt;/body&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload