I have the following problem trying to make scrollable the tbody section of an HTML table.
So for example I have this simple HTML table:
<table border="1" class="scrollableTable">
<thead>
<tr>
<th width="14.2%">Codice RM</th>
<th width="14.2%">Autore Firma</th>
<th width="14.2%">Data Firma</th>
<th width="14.2%">Acq Riserva</th>
<th width="14.2%">Consegna Finale</th>
<th width="14.2%">Descrizione RM</th>
<th width="14.2%">Imponibile</th>
</tr>
</thead>
<tbody>
<tr class="even" id="rmRow">
<td width="14.2%">0001</td>
<td width="14.2%">bla</td>
<td width="14.2%">00000000</td>
<td width="14.2%">bla</td>
<td width="14.2%">bla</td>
<td width="14.2%">19/09</td>
<td width="14.2%">57.0</td>
</tr>
<tr class="even" id="rmRow">
<td width="14.2%">0002</td>
<td width="14.2%">bla</td>
<td width="14.2%">00000000</td>
<td width="14.2%">bla</td>
<td width="14.2%">bla</td>
<td width="14.2%">19/09</td>
<td width="14.2%">57.0</td>
</tr>
<tr class="even" id="rmRow">
<td width="14.2%">0003</td>
<td width="14.2%">bla</td>
<td width="14.2%">00000000</td>
<td width="14.2%">bla</td>
<td width="14.2%">bla</td>
<td width="14.2%">19/09</td>
<td width="14.2%">57.0</td>
</tr>
<tr class="even" id="rmRow">
<td width="14.2%">0004</td>
<td width="14.2%">bla</td>
<td width="14.2%">00000000</td>
<td width="14.2%">bla</td>
<td width="14.2%">bla</td>
<td width="14.2%">19/09</td>
<td width="14.2%">57.0</td>
</tr>
<tr class="even" id="rmRow">
<td width="14.2%">0005</td>
<td width="14.2%">bla</td>
<td width="14.2%">00000000</td>
<td width="14.2%">bla</td>
<td width="14.2%">bla</td>
<td width="14.2%">19/09</td>
<td width="14.2%">57.0</td>
</tr>
<tr class="even" id="rmRow">
<td width="14.2%">0006</td>
<td width="14.2%">bla</td>
<td width="14.2%">00000000</td>
<td width="14.2%">bla</td>
<td width="14.2%">bla</td>
<td width="14.2%">19/09</td>
<td width="14.2%">57.0</td>
</tr>
</tbody>
</table>
As you can see in the tbody section there are some rows. These rows could be many so I want that this section have a specific heightand that it is scrollable (so I can see all the rows).
So I add these CSS settings trying to do it:
First I set the tbody section as a block so I can set an height to it.
Then I set an height to the tbody section.
Finally I set the verical overflow as scroll to make scrollable my tbody section.
This is my CSS code:
tbody {
display: block;
height: 100px;
overflow-y: scroll;
}
But this is what I obtain:
JSFiddle link: http://jsfiddle.net/AndreaNobili/4v1xnwzo/2/
HTML result: http://jsfiddle.net/AndreaNobili/4v1xnwzo/2/embedded/result/
As you can see the final result is pretty horrible and the tbody columns don't match wuth the thead columns.
Why? What am I missing? How can I solve this issue?
Tnx
The cells in your tbody will only line up with the cells in the thead if it has display: table-row-group;. Thus we can't set a height on the tbody, so we have to find a workaround.
The table itself can have overflow-y: scroll;, which gives us the scrolling for the rows in tbody, but unfortunately also includes scrolling the thead. You can avoid this behaviour by fixed positioning thead. and manipulating the way its displayed a little to make it look static at the top of the table while the rest of the table scrolls.
I've updated your JSFiddle with the css below:
tbody {
margin-top: 40px;
}
table {
display: block;
height: 100px;
overflow-y: scroll;
position: relative;
margin-top: 50px;
}
thead {
background: white;
position: fixed;
top: 0;
margin-right: 25px;
display: table-row-group;
}
th, td {
width: 80px;
}
Related
I have made an html page to display a status dash board for some of the systems at work. The systems in the first seven rows are kind of interconnected, so in addition to the status for each of them, I want to present the status for the combination of the seven systems. Technically this works great, but I am not entirely happy with the layout. I would like to have the yellow bar at the left to take up a smaller part of the first colum, not half of it.
The first three rows of the table are coded as:
<tr><th id="namehead"></th><th colspan="2" class="typehead">Data</th>
<th class="typehead">Strøm</th><th class="typehead">Komm.</th></tr>
<tr id="sys1"><td id="agg_data" class="data agg" rowspan="7" td><td id="sys1_data"
class="data sys1"></td><td id="sys1_power" class="power sys1"></td><td id="sys1_comm"
class="comm sys1"></td></tr>
<tr id="sys2"><td id="sys2_data" class="data"></td><td id="sys2_power" class="power"></td>
<td id="sys2_comm" class="comm"></td></tr>
Then from the 8th status row, I do:
<tr id="arc"><td id="arc_data" class="data" colspan="2"></td>
<td id="arc_power" class="power"></td><td id="arc_comm" class="comm"></td></tr>
in my css, the class "typehead" has set {width: 100px;}. I have tried to set width on the cells of the first status row, although it does not give me any kind of errors, it does not work either (firefox and chrome) Is it somehow possible to achieve this in css?
Most likely the content is stretching the table cell. You can avoid this if you wrap the content in a div and size it as needed. And, as an option, arrange the text vertically.
.typehead {
width: 100px;
font: bold 20px/1 sans-serif;
color: #e3e3e3;
background-color: #262626;
}
td {
padding: 4px;
text-align: right;
background-color: #31a72c;
}
tr:nth-child(2) td:nth-child(1) {
width: 1em;
background-color: #ffee52;
}
.vertical {
writing-mode: vertical-rl;
transform: rotate(.5turn);
}
<table>
<tr>
<!--th id="namehead"></th-->
<th colspan="2" class="typehead">Data</th>
<th class="typehead">Strøm</th>
<th class="typehead">Komm.</th>
</tr>
<tr id="sys1">
<td id="agg_data" class="data agg" rowspan="7">
<div class='vertical'>agg_data</div>
</td>
<td id="sys1_data" class="data sys1">sys1_data</td>
<td id="sys1_power" class="power sys1">sys1_power</td>
<td id="sys1_comm" class="comm sys1">sys1_comm</td>
</tr>
<tr id="sys2">
<td id="sys2_data" class="data">sys2_data</td>
<td id="sys2_power" class="power">sys2_power</td>
<td id="sys2_comm" class="comm">sys2_comm</td>
</tr>
<tr id="sys3">
<td id="sys3_data" class="data">sys3_data</td>
<td id="sys3_power" class="power">sys3_power</td>
<td id="sys3_comm" class="comm">sys3_comm</td>
</tr>
<tr id="sys4">
<td id="sys4_data" class="data">sys4_data</td>
<td id="sys4_power" class="power">sys4_power</td>
<td id="sys4_comm" class="comm">sys4_comm</td>
</tr>
<tr id="sys5">
<td id="sys5_data" class="data">sys5_data</td>
<td id="sys5_power" class="power">sys5_power</td>
<td id="sys5_comm" class="comm">sys5_comm</td>
</tr>
<tr id="sys6">
<td id="sys6_data" class="data">sys6_data</td>
<td id="sys6_power" class="power">sys6_power</td>
<td id="sys6_comm" class="comm">sys6_comm</td>
</tr>
<tr id="sys7">
<td id="sys7_data" class="data">sys7_data</td>
<td id="sys7_power" class="power">sys7_power</td>
<td id="sys7_comm" class="comm">sys7_comm</td>
</tr>
<tr id="arc">
<td id="arc_data" class="data" colspan="2">arc_data</td>
<td id="arc_power" class="power">arc_power</td>
<td id="arc_comm" class="comm">arc_comm</td>
</tr>
<tr id="arc">
<td id="arc_data" class="data" colspan="2">arc_data</td>
<td id="arc_power" class="power">arc_power</td>
<td id="arc_comm" class="comm">arc_comm</td>
</tr>
<tr id="arc">
<td id="arc_data" class="data" colspan="2">arc_data</td>
<td id="arc_power" class="power">arc_power</td>
<td id="arc_comm" class="comm">arc_comm</td>
</tr>
<tr id="arc">
<td id="arc_data" class="data" colspan="2">arc_data</td>
<td id="arc_power" class="power">arc_power</td>
<td id="arc_comm" class="comm">arc_comm</td>
</tr>
<tr id="arc">
<td id="arc_data" class="data" colspan="2">arc_data</td>
<td id="arc_power" class="power">arc_power</td>
<td id="arc_comm" class="comm">arc_comm</td>
</tr>
</table>
I would like to create this table in html
https://i.stack.imgur.com/cluOC.png
I tried this code:
<table>
<tr>
<th class="blue" colspan="3">3</th>
<th class="orange " rowspan="2">2</th>
<th class="blue" colspan="3">3</th>
</tr>
<tr>
<td class="cyan" rowspan="4">4</td>
<td class="cyan">1</td>
<td class="cyan">1</td>
<td class="cyan">1</td>
<td class="cyan">1</td>
<td class="cyan" rowspan="4">4</td>
</tr>
<tr>
<td class="orange" colspan="2">2</td>
<td class="orange" rowspan="3">3</td>
<td class="orange" colspan="2">2</td>
</tr>
<tr>
<td class="cyan" rowspan="2">2</td>
<td class="cyan" rowspan="2">2</td>
<td class="cyan" rowspan="2">2</td>
<td class="cyan" rowspan="2">2</td>
</tr>
<tr>
</tr>
<tr>
<td class="green" colspan="2">2</td>
<td class="orange">1</td>
<td class="cyan">1</td>
<td class="orange">1</td>
<td class="green" colspan="2">2</td>
</tr>
</table>
but output is this, one of the rows (penultimate row) is not displayed
https://i.stack.imgur.com/Nmdtl.png
how can I fix it?
This happens because empty tr does not have any height in html DOM.
You can add few CSS height and width properties to get it consistent. i.e-
td {
min-height: 2em;
min-width: 2em;
}
tr {
height: 2em;
}
.blank-row {
height: 2em;
}
And then add class blank-row to the empty row you have written.
<tr class="blank-row"></tr>
It would render properly then:
First of all, your 5th "row" isn't really a row - it doesn't contain any cells. Rows don't have any height if there is no content in them. If you created that 5th row only to make the cells above it higher, then you better use height settings on the cells.
You can apply a heightsetting to one of the cells in the 4th row which is twice as mhigh as the other ("regular") cells. I did that using the x class in the example below.
table {
min-width: 400px;
border-collapse: collapse;
}
th, td {
border: 1px solid #555;
height: 60px;
text-align: center;
}
.x {
height: 120px;
}
<table>
<tr>
<th class="blue" colspan="3">3</th>
<th class="orange " rowspan="2">2</th>
<th class="blue" colspan="3">3</th>
</tr>
<tr>
<td class="cyan" rowspan="4">4</td>
<td class="cyan">1</td>
<td class="cyan">1</td>
<td class="cyan">1</td>
<td class="cyan">1</td>
<td class="cyan" rowspan="4">4</td>
</tr>
<tr>
<td class="orange" colspan="2">2</td>
<td class="orange" rowspan="3">3</td>
<td class="orange" colspan="2">2</td>
</tr>
<tr>
<td class="cyan x" rowspan="2">2</td>
<td class="cyan" rowspan="2">2</td>
<td class="cyan" rowspan="2">2</td>
<td class="cyan" rowspan="2">2</td>
</tr>
<tr>
</tr>
<tr>
<td class="green" colspan="2">2</td>
<td class="orange">1</td>
<td class="cyan">1</td>
<td class="orange">1</td>
<td class="green" colspan="2">2</td></tr>
</table>
I have a simple html table where i am trying to get the body to extend to the end of the headers/table. I need it to have horizontal scroll only for the body and have fixed headers.
I have a fiddle here that shows the issue.
http://jsfiddle.net/ZbdZe/54/
<table border="1" width="100%">
<thead >
<tr>
<th id="th1" width="50%">first</th>
<th id="th2" width="50%" >last</th>
</tr>
</thead>
<tbody style="display: block; border: 1px solid green; height: 530px; overflow-y: scroll">
<tr>
<td headers="th1" >Hello</td>
<td headers="th2" >World</td>
</tr>
</tbody>
</table>
Right now it extendes only the first heading. I need it to extend the full width of the table with scroll. Thank you
This is to have fixed table header created by another table
Second table for the body of the table with scroll
table{
border-collapse:collapse;
width:100%
}
tbody{
border: 1px solid green;
table-layout: fixed;
}
div{
height: 66px; /*adjust table body*/
overflow-y: scroll
}
<table border="1">
<thead>
<tr>
<th id="th1" width="39%">first</th>
<th id="th2" width="50%" >last</th>
</tr>
</thead>
</table>
<div>
<table border=1>
<tbody>
<tr>
<td headers="th1" >Hello</td>
<td headers="th2" >World</td>
</tr>
<tr>
<td headers="th1" >Hello</td>
<td headers="th2" >World</td>
</tr>
<tr>
<td headers="th1" >Hello</td>
<td headers="th2" >World</td>
</tr>
<tr>
<td headers="th1" >Hello</td>
<td headers="th2" >World</td>
</tr>
</tbody>
</table>
</div>
The following HTML code displays the value of Heading9 and Heading10 in a separate row instead of displaying right after Heading8 (see ActualOutput image)
Code 1:
<html><body bgcolor="#E6E6FA">
<TABLE cellpadding="5" style="border: 1px solid #000000; border-collapse: collapse;" border="2">
<TH>Heading1</TH>
<TH>Heading2</TH>
<TH>Heading3</TH>
<TH>Heading4</TH>
<TH>Heading5</TH>
<TH>Heading6</TH>
<TH>Heading7</TH>
<TH>Heading8</TH>
<TH>Heading9</TH>
<TH>Heading10</TH>
<TH colspan="20">Heading11</TH>
</TR>
<tbody>
<TR>
<TD rowspan="2">knnjkn</TD>
<TD>ceecev</TD>
<TD>lnlnlkn</TD>
<TD>lknlkn</TD>
<TD>lknkn</TD>
<TD>kjnkljnk</TD>
<TD>lknlkn</TD>
<TD>kjnlkn</TD>
<TD>kjbkn</TD>
</TR>
<TR>
<TD>jknklnk</TD>
<TD>kjnlknknm</TD>
<TD>jnkj n</TD>
<TD>lnnkkl</TD>
<TD>kjnknkj</TD>
<TD>sdwewcw</TD>
<TD>qwdcwcwc</TD>
<TD>csdcs</TD>
</TR>
<TD rowspan="2" bgcolor=#00BFFF>SUCCESS</TD>
<TD rowspan="2" bgcolor=#00BFFF>SUCCESS</TD>
<TD rowspan="2" bgcolor=#00BFFF>SUCCESS</TD>
</tbody>
<tbody>
<TR>
<TD rowspan="2">ddccs</TD>
<TD>csdcs</TD>
<TD>csdcs</TD>
<TD>cswewc</TD>
<TD>csdcsdc</TD>
<TD>cdwdc</TD>
<TD>cdsc</TD>
<TD>zcxascsac</TD>
<TD>csdcdc</TD>
</TR>
<TR>
<TD>dadcc</TD>
<TD>csdc</TD>
<TD>cacsc</TD>
<TD>cdwcc</TD>
<TD>csdd</TD>
<TD>csdc</TD>
<TD>sdcsdc</TD>
<TD>cdscsd</TD>
</TR>
<TD rowspan="2" bgcolor=#00BFFF>SUCCESS</TD>
<TD rowspan="2" bgcolor=#00BFFF>SUCCESS</TD>
<TD rowspan="2" bgcolor=#00BFFF>SUCCESS</TD>
</tbody>
</TABLE>
</html>
Actual Output:
I can get the desired output by changing the code 1 to code 2, however, my bash script gathers Heading9 and Heading10 data only after Heading8 is framed for each body, so I cannot inject Heading9 and 10 in between.
Appreciate if experts can provide a better solution to get the expected output by restructuring the code 1. Unfortunately, code 2 doesn't work in my scenario.
Code 2:
<html><body bgcolor="#E6E6FA">
<TABLE cellpadding="5" style="border: 1px solid #000000; border-collapse: collapse;" border="2">
<TH>Heading1</TH>
<TH>Heading2</TH>
<TH>Heading3</TH>
<TH>Heading4</TH>
<TH>Heading5</TH>
<TH>Heading6</TH>
<TH>Heading7</TH>
<TH>Heading8</TH>
<TH>Heading9</TH>
<TH>Heading10</TH>
<TH colspan="20">Heading11</TH>
</TR>
<tbody>
<TR>
<TD rowspan="2">knnjkn</TD>
<TD>ceecev</TD>
<TD>lnlnlkn</TD>
<TD>lknlkn</TD>
<TD>lknkn</TD>
<TD>kjnkljnk</TD>
<TD>lknlkn</TD>
<TD>kjnlkn</TD>
<TD>kjbkn</TD>
<TD rowspan="2" bgcolor=#00BFFF>SUCCESS</TD>
<TD rowspan="2" bgcolor=#00BFFF>SUCCESS</TD>
<TD rowspan="2" bgcolor=#00BFFF>SUCCESS</TD>
</TR>
<TR>
<TD>jknklnk</TD>
<TD>kjnlknknm</TD>
<TD>jnkj n</TD>
<TD>lnnkkl</TD>
<TD>kjnknkj</TD>
<TD>sdwewcw</TD>
<TD>qwdcwcwc</TD>
<TD>csdcs</TD>
</TR>
</tbody>
<tbody>
<TR>
<TD rowspan="2">ddccs</TD>
<TD>csdcs</TD>
<TD>csdcs</TD>
<TD>cswewc</TD>
<TD>csdcsdc</TD>
<TD>cdwdc</TD>
<TD>cdsc</TD>
<TD>zcxascsac</TD>
<TD>csdcdc</TD>
<TD rowspan="2" bgcolor=#00BFFF>SUCCESS</TD>
<TD rowspan="2" bgcolor=#00BFFF>SUCCESS</TD>
<TD rowspan="2" bgcolor=#00BFFF>SUCCESS</TD>
</TR>
<TR>
<TD>dadcc</TD>
<TD>csdc</TD>
<TD>cacsc</TD>
<TD>cdwcc</TD>
<TD>csdd</TD>
<TD>csdc</TD>
<TD>sdcsdc</TD>
<TD>cdscsd</TD>
</TR>
</tbody>
</TABLE>
</html>
Expected Output:
Add Following may this help...
<style>
table
{
border: 1px solid #000000;
border-collapse: collapse;
display:table;
position:relative;
width:100%;
}
table tr
{
display: table-row;
height: 35px;
line-height: 30px;
width: 100%;
}
table td
{
direction: ltr;
display: table-cell;
margin: 0;
padding: 5px;
table-layout: fixed;
}
</style>
What is causing scroll bar to not be clipped on side of table in this fiddle: http://jsfiddle.net/m4HB3/8/ At the moment it is underneath the last column, meaning it is taking up some of that columns space and thus causing alignment issues with the table.
The table headers are fixed as I want a scrolling table with fixed headers.
Could the problem be the width set for the table and individual columns?
Can somebody please also text their answer on a script outside jsfiddle and put it straight on a browser because I have seen examples where something is working in jsifddle but then not working in main application on browser.
HTML:
<table id="tableqanda" cellpadding="0" cellspacing="0">
<thead>
<tr>
<th width="5%" class="questionno">Question No.</th>
<th width="27%" class="question">Question</th>
<th width="7%" class="option">Option Type</th>
<th width="11%" class="image">Image</th>
</tr>
</thead>
</table>
<div id="tableqanda_onthefly_container">
<table id="tableqanda_onthefly" cellpadding="0" cellspacing="0">
<tbody>
<tr class="tableqandarow">
<td width="5%" class="questionno">1</td>
<td width="27%" class="question">What is a RAM?</td>
<td width="7%" class="option">A-E</td>
<td width="11%" class="imagetd"><ul class="qandaul"><li>Lighthouse_4.jpg</li></ul></td>
</tr>
<tr class="tableqandarow">
<td width="5%" class="questionno">2</td>
<td width="27%" class="question">Name 3 car maneuvers you may do in a test?</td>
<td width="7%" class="option">A-F</td>
<td width="11%" class="imagetd"><ul class="qandaul"><li>Tulips_3.jpg</li></ul></td>
</tr>
</tbody>
</table>
</div>
CSS:
#tableqanda_onthefly_container
{
width:100%;
overflow-y: auto;
overflow-x: hidden;
max-height:25px;
}
#tableqanda_onthefly
{
width:100%;
overflow-y: auto;
overflow-x: hidden;
clear:both;
}
#tableqanda_onthefly td
{
border:1px black solid;
border-collapse:collapse;
}
#tableqanda, #tableqanda_onthefly{
border:1px black solid;
border-collapse:collapse;
table-layout:fixed;
word-wrap:break-word;
}
#tableqanda{
width:100%;
margin-left:0;
float:left;
}
#tableqanda td {
vertical-align: middle;
border:1px black solid;
border-collapse:collapse;
}
#tableqanda th{
border:1px black solid;
border-collapse:collapse;
text-align:center;
}
.tableqandarow{
border:1px black solid;
border-collapse:collapse;
}
UPDATE:
http://jsfiddle.net/m4HB3/37/
I have a js fiddle which works perfectly. But if you copy code into a standard html, the columns are not aligned. If you can get the columns aligned correctly with their headings with the scroll bar on the side of the table, then that will be perfect answer
Is that something what could work for you?
Using here script/jQuery within your div to scroll, slightly modified css to give side scrolling.
Please see: http://jsfiddle.net/m4HB3/177
Here's standalone version: http://webapper.pl/demo.html
I didn't spend much time on css but i'm sure you could make it look pretty.
var ele = $('.scroll');
var scroll = 25;
$('.up').on('click',function() {
ele.scrollTop( ele.scrollTop() - scroll );
});
$('.down').on('click',function() {
ele.scrollTop( ele.scrollTop() + scroll );
});
Or you can use static table width (that would also fix your problem):
http://jsfiddle.net/m4HB3/178/
Here is a fiddle based on the linked question by Sara:
DEMO
html
<div id="tableContainer" class="tableContainer">
<table width="100%" cellspacing="0" cellpadding="0" border="0" class="scrollTable">
<col width="10%" />
<col width="54%" />
<col width="14%" />
<col width="22%" />
<thead class="fixedHeader">
<tr>
<th class="questionno">Question No.</th>
<th class="question">Question</th>
<th class="option">Option Type</th>
<th class="image">Image</th>
</tr>
</thead>
<tbody class="scrollContent">
<tr>
<td class="questionno">1</td>
<td class="question">What is a RAM?</td>
<td class="option">A-E</td>
<td class="imagetd"><ul class="qandaul"><li>Lighthouse_4.jpg</li></ul></td>
</tr>
<tr>
<td class="questionno">2</td>
<td class="question">Name 3 car maneuvers you may do in a test?</td>
<td class="option">A-F</td>
<td class="imagetd"><ul class="qandaul"><li>Tulips_3.jpg</li></ul></td>
</tr>
<tr>
<td class="questionno">3</td>
<td class="question">What is a RAM?</td>
<td class="option">A-E</td>
<td class="imagetd"><ul class="qandaul"><li>Lighthouse_4.jpg</li></ul></td>
</tr>
<tr>
<td class="questionno">4</td>
<td class="question">Name 3 car maneuvers you may do in a test?</td>
<td class="option">A-F</td>
<td class="imagetd"><ul class="qandaul"><li>Tulips_3.jpg</li></ul></td>
</tr>
<tr>
<td class="questionno">5</td>
<td class="question">What is a RAM?</td>
<td class="option">A-E</td>
<td class="imagetd"><ul class="qandaul"><li>Lighthouse_4.jpg</li></ul></td>
</tr>
<tr>
<td class="questionno">6</td>
<td class="question">Name 3 car maneuvers you may do in a test?</td>
<td class="option">A-F</td>
<td class="imagetd"><ul class="qandaul"><li>Tulips_3.jpg</li></ul></td>
</tr>
<tr>
<td class="questionno">7</td>
<td class="question">What is a RAM?</td>
<td class="option">A-E</td>
<td class="imagetd"><ul class="qandaul"><li>Lighthouse_4.jpg</li></ul></td>
</tr>
<tr>
<td class="questionno">8</td>
<td class="question">Name 3 car maneuvers you may do in a test?</td>
<td class="option">A-F</td>
<td class="imagetd"><ul class="qandaul"><li>Tulips_3.jpg</li></ul></td>
</tr>
</tbody>
</table>
</div>
css
div.tableContainer {
clear: both;
border: 1px solid #963;
overflow: auto;
}
html>body tbody.scrollContent {
display: block;
height: 100px;
overflow: auto;
width: 100%
}
html>body thead.fixedHeader tr {
display: block
}
html>body td {
box-sizing: border-box;
border: 1px solid grey;
}
table .questionno {
width: 10%;
}
table .question {
width: 54%;
}
table .option {
width: 14%;
}
table .image {
width: 22%;
}