Add rowspan tag to sequence column


Hi,
I want to ask, how to add rowspan=“2” to the sequence column?
on the export=print page, if on the listpage page it works using the following code

$(document).ready(function() {
$("th").filter(function() {
if ($(this).text().trim() === "NO.") {
$(this).attr("rowspan", 2);
$(this).css("vertical-align", "middle"); // Add vertical-align style
return true; // Keep returning true so that this element is selected
}
return false;
});
});

but not on the print page, any ideas?

  1. You better view source in your browser to check the output HTML.
  2. Why did you put your code? Are you sure it is executed in export mode?

I put the code for the listpage page and the code works, but when I press print, the sequence column doesn’t work rowspan=“2”. can you help me. I still can’t understand about this export=print page.
I want to add logic if (IsExport=“print”) is there any?

Note that in printer friendly version, there is startup script. If you put it there, it won’t work. You may add your code in Page_Head server event, check if IsExport("print") and output a script tag with your code.

ok my problem now when exporting excel file, sequence column doesn’t respond to rowspan tag?
do you where my mistake?
this is my code

function Page_Exporting(&$doc)
{ 
if ($this->isExport("excel")) { 
$doc->Text = ' 
<table border="1"> 
<tr style="background-color: #0070C0; color: white;"> 
<th rowspan="2">NO.</th> 
<th rowspan="2">FUEL STATUS</th> 
<th rowspan="2">DATE</th> 
<th rowspan="2">UNIT CODE</th> 
<th rowspan="2">DESCRIPTION</th> 
<th rowspan="2">OPERATOR</th> 
<th rowspan="2">SHIFT</th> 
<th colspan="3">HOURMETER</th> 
<th colspan="3">KILOMETERS</th> 
<th colspan="2">FLOWMETER</th> 
<th colspan="3">FUEL</th> 
<th rowspan="2">LITERS AN HOUR</th> 
<th rowspan="2">FUEL IN</th> 
<th rowspan="2">TOTAL LITERS</th> 
</tr> 
<tr style="background-color: #0070C0; color: white;"> 
<th>PRIOR HM</th> 
<th>HM</th> 
<th>HM DIFFERENCE</th> 

<th>PREVIOUS KM</th> 
<th>KM</th> 
<th>KM DIFFERENCE</th> 

<th>FLOW ST</th> 
<th>FLOW EN</th> 
<th>PREVIOUS FUEL</th> 
<th>FUEL OUT</th> 
<th>FUEL OUT DIFFERENCE</th> 
</tr> 
</table> 
'; 
} 
return true; // Return true to use default export and skip Row_Export event
}

There is no sequence number when you export to other format than printer friendly. If you want to add, you need to use the Row_Export server event to add the sequence number yourself.