ce icon indicating copy to clipboard operation
ce copied to clipboard

Not able to set initial row height

Open Swechhya opened this issue 7 years ago • 5 comments

I want to set inital row height to a row. According to the examples the following code should work:

<script>
jexcel(document.getElementById('myTable'), {
    data:data,
    rows:[ 3: { height:500 }],
});
</script>

But when I add the rows attribute as shown above, the table fails to render. Follwoing is the code that does not seem to work:

<html>
<script src="https://bossanova.uk/jexcel/v3/jexcel.js"></script>
<link rel="stylesheet" href="https://bossanova.uk/jexcel/v3/jexcel.css" type="text/css" />

<script src="https://bossanova.uk/jtools/v2/japp.js"></script>
<link rel="stylesheet" href="https://bossanova.uk/jtools/v2/japp.css" type="text/css" />

<div id="spreadsheet"></div>

<script>
var data = [
    ['Mazda', 2001, 2000],
    ['Pegeout', 2010, 5000],
    ['Honda Fit', 2009, 3000],
    ['Honda CRV', 2010, 6000],
];

jexcel(document.getElementById('spreadsheet'), {
    data:data,
    columns:[
        { title:'Model', width:300 },
        { title:'Price', width:80 },
        { title:'Model', width:100 }
    ],
  rows:[ 3: { height:500 }],
});
</script>
</html>

Swechhya avatar Jun 29 '19 14:06 Swechhya

Please change your code:

var data = [
    ['Mazda', 2001, 2000],
    ['Pegeout', 2010, 5000],
    ['Honda Fit', 2009, 3000],
    ['Honda CRV', 2010, 6000],
];

jexcel(document.getElementById('spreadsheet'), {
    data:data,
    columns:[
        { title:'Model', width:300 },
        { title:'Price', width:80 },
        { title:'Model', width:100 }
    ],
  rows:{ 3: { height:500 }},
});

pphod avatar Jun 29 '19 14:06 pphod

is there any option to set default height for all rows?

seulZarraga avatar Sep 08 '19 02:09 seulZarraga

Not in the current version. Can you create that as a new feature request in a new thread?

pphod avatar Sep 08 '19 09:09 pphod

Is it solved ? Default row height option ?

thelightbringer avatar Dec 12 '19 11:12 thelightbringer

You can define that thought CSS since jExcel is just a regular HTML table.

pphod avatar Dec 12 '19 21:12 pphod