How to remove row gap between two tables in Laravel maatwebsite/excel FromView - excel

I want to export order and order item data in my laravel web app in xls format so i decided to try using maatwebsite/excel v3.1. I'm using FromView class to convert blade template into an excel file, the blade structure looks like this:
<table>
<thead>
<tr>
<th> Order# </th>
<th> Customer </th>
<th> Order Date </th>
<th> Total </th>
</tr>
</thead>
<tbody>
<tr>
<td> 1132 </td>
<td> Ashin </td>
<td> 21-11-2021 </td>
<td> 3000.00$ </td>
</tr>
</tbody>
</table>
<table>
<thead>
<tr>
<th colspan="4"> Order Items </th>
</tr>
<tr>
<th> Product </th>
<th> Price </th>
<th> Qty </th>
<th> Subtotal </th>
</tr>
</thead>
<tbody>
<tr>
<td> Bag </td>
<td> 1200.00$ </td>
<td> 2 </td>
<td> 2400.00$ </td>
</tr>
<tr>
<td> Hat </td>
<td> 600.00$ </td>
<td> 1 </td>
<td> 600.00$ </td>
</tr>
</tbody>
</table>
and the results looks like this:
there is a row gap between these two tables, how can i remove it?

Related

Need the full correct html code for this Table

Image table
Please write full html codes for this table. You may see the Table image from above via the link.
<table border="1" width="800">
<tr>
<th>Level1</th>
<th>Level2</th>
<th>Level2</th>
<th>Info</th>
<th>Name</th>
</tr>
<tr>
<td rowspan="6">System</td>
</tr>
<tr>
<td rowspan="4">System Apps</td>
<td rowspan="2">System Memory</td>
</tr>
<tr>
<td rowspan="3">SystemEnv</td>
<td rowspan="1">SystemEnv2</td>
<td rowspan="2">Memeory Test</td>
</tr>
Here is the table code :
<table border="2">
<tr>
<th>Level 1</th>
<th>Level 2</th>
<th>Level 3</th>
<th>info</th>
<th>Name</th>
</tr>
<tr>
<td rowSpan="6">System</td>
<td rowSpan="4">System apps</td>
<td rowSpan="3">SystemEnv</td>
<td>App Text</td>
<td>foo</td>
</tr>
<tr>
<td>App memory</td>
<td>foo</td>
</tr>
<tr>
<td>App test</td>
<td>bar</td>
</tr>
<tr>
<td>Systemenv2</td>
<td>App test</td>
<td>bar</td>
</tr>
<tr>
<td rowSpan="2">System Memory</td>
<td rowSpan="2">Memory test</td>
<td>memory func</td>
<td>foo</td>
</tr>
<tr>
<td>Memory Func</td>
<td>foo</td>
</tr>
</table>

Creating a custom button in Jodit Editor

I'm trying to create a custom table button using Jodit React Editor using this as reference - https://xdsoft.net/jodit/examples/toolbar/custom_button.html
I'm a little lost on this though.
I need to be able to create a table and have the icon be a text icon that says - "Table"
Right now I've added this to my configurations - extraButtons: ['tableNew'].
I've also added the below code to the render method.
this.jodit.options.controls.tableNew = {
iconURL: '',
exec: function (editor) {
return '<table> <thead> <tr> <th> Sl no </th> <th>Name</th> <th>Age</th> </tr> </thead>'+
' <tbody> <tr> <td>1</td> <td></td> <td></td> </tr> </tbody> </table>';
}
};
I see that a space has been added in the toolbar which on hover says tableNew but on clicking it nothing happens.
I'd really appreciate it if someone could help me out with this.
Instead of the following,
return '<table> <thead> <tr> <th> Sl no </th> <th>Name</th> <th>Age</th> </tr> </thead> <tbody> <tr> <td>1</td> <td></td> <td></td> </tr> </tbody> </table>';
try something like this:
return editor.create.fromHTML('<table> <thead> <tr> <th> Sl no </th> <th>Name</th> <th>Age</th> </tr> </thead> <tbody> <tr> <td>1</td> <td></td> <td></td> </tr> </tbody> </table>');
This works for me (a similiar implementation, not returning table like you, but return some list).

Get tr having specific th value from the table having an id using Xpath

I am using python3.6 with XPath library. Crawling inside the table gives me an empty list. And need to crawl to specific th.
My tr contents are dynamically generated. I need to crawl to tr which has a specific th value. Example In HTML code, the Rank appears in the second tr but it can appear in anywhere in tr. It doesn't have a specific index. Need to get the href from the tr having the Rank th.
My html file:
<tbody>
<tr>
<th class="a-color-secondary a-size-base prodDetSectionEntry">
Product Number
</th>
<td class="a-size-base">
B003NR57BY
</td>
</tr>
<tr>
<th class="a-color-secondary a-size-base prodDetSectionEntry">
Rank
</th>
<td>
<span>
<span>#3 in Computer Mice</span>
<br>
</span>
</td>
</tr>
<tr>
<th class="a-color-secondary a-size-base prodDetSectionEntry">
Created Date
</th>
<td class="a-size-base">
June 7, 2010
</td>
</tr>
</tbody>
</table>
Python code:
listings_details = parser.xpath(XPATH_PRODUCT_DETAILS)
for row in listings_details:
th = row.xpath("./th/text()")
if th[0].strip() == 'Rank':
categories = row.xpath("./td/span/span//text()")
qid_url= row.xpath("./td/span/span//#href")
I expect the output to be
Rank: 3,
url : /gp/bestsellers/pc/11036491/ref=pd_zg_hrsr_pc_1_1_last,
category: Computer Mice
Need to get the href from the tr having the Rank th.
Use:
/table/tbody/tr[normalize-space(th)='Rank']/td//a/#href
Note: this works for your provided fragment (now well-formed). You need to add later a context for selecting the table element.
<table>
<tbody>
<tr>
<th class="a-color-secondary a-size-base prodDetSectionEntry">Product Number</th>
<td class="a-size-base">B003NR57BY</td>
</tr>
<tr>
<th class="a-color-secondary a-size-base prodDetSectionEntry">Rank</th>
<td>
<span>
<span>#3 in
Computer Mice
</span>
<br/>
</span>
</td>
</tr>
<tr>
<th class="a-color-secondary a-size-base prodDetSectionEntry">Created Date</th>
<td class="a-size-base">June 7, 2010</td>
</tr>
</tbody>
</table>
Test in http://www.xpathtester.com/xpath/53808ee94dfbc5b38f12791cf857ffb9

How to pass product TVs to SimpleCart's scGetCart snippet?

I need some TVs (weight, dimensions, etc) I've associated with my products to appear in the Cart page of my SimpleCart site.
Problem is I have no idea how to do this. I don't understand how the SimpleCart cart is built and there isn't documentation for this.
Would anyone know how I can show TVs associated with each product in the cart output chunk?
The cart snippet has the following code which gets data from the cart and puts it into Chunks:
$sc = $modx->getService('simplecart','SimpleCart',$modx->getOption('simplecart.core_path',null,$modx->getOption('core_path').'components/simplecart/').'model/simplecart/',$scriptProperties);
if (!($sc instanceof SimpleCart)) return '';
 
$controller = $sc->loadController('Cart');
$output = $controller->run($scriptProperties);
The output Chunk looks like:
<div id="simplecart">
<form action="[[~[[*id]]]]" method="post" id="form_cartoverview">
<input type="hidden" name="updatecart" value="true" />
<table>
<tr>
<th class="desc">[[%simplecart.cart.description]]</th>
<th class="price">[[%simplecart.cart.price]]</th>
<th class="quantity">[[%simplecart.cart.quantity]]</th>
[[+cart.total.vat_total:notempty=`<th class="quantity">[[%simplecart.cart.vat]]</th>`:isempty=``]]
<th class="subtotal">[[%simplecart.cart.subtotal]]</th>
<th> </th>
</tr>
[[+cart.wrapper]]
[[+cart.total.discount:notempty=`<tr class="total first discount">
<td colspan="[[+cart.total.vat_total:notempty=`3`:isempty=`2`]]"> </td>
<td class="label">[[%simplecart.cart.discount]]</td>
<td class="value">- [[+cart.total.discount_formatted]]</td>
<td class="extra">[[+cart.total.discount_percent:notempty=`([[+cart.total.discount_percent]]%)`:isempty=` `]]</td>
</tr>`:isempty=``]]
[[+cart.total.vat_total:notempty=`
<tr class="total [[+cart.total.discount:notempty=`second`:isempty=`first`]]">
<td colspan="3"> </td>
<td class="label">[[%simplecart.cart.total_ex_vat]]</td>
<td class="value">[[+cart.total.price_ex_vat_formatted]]</td>
<td class="extra"> </td>
</tr>
[[+cart.vat_rates]]
<tr class="total [[+cart.total.discount:notempty=`third`:isempty=`second`]]">
<td colspan="3"> </td>
<td class="label">[[%simplecart.cart.total_vat]]</td>
<td class="value">[[+cart.total.vat_total_formatted]]</td>
<td class="extra"> </td>
</tr>
<tr class="total [[+cart.total.discount:notempty=`fourth`:isempty=`third`]]">
<td colspan="3"> </td>
<td class="label">[[%simplecart.cart.total_in_vat]]</td>
<td class="value">[[+cart.total.price_formatted]]</td>
<td class="extra"> </td>
</tr>
`:isempty=`
<tr class="total [[+cart.total.discount:notempty=`second`:isempty=`first`]]">
<td colspan="2"> </td>
<td class="label">[[%simplecart.cart.total]]</td>
<td class="value">[[+cart.total.price_formatted]]</td>
<td class="extra"> </td>
</tr>
`]]
</table>
<div class="submit">
<input type="submit" value="[[%simplecart.cart.update]]" />
</div>
</form>
This does appear to be documented:
Product Options (TVs)
and to output them:
Modifying the Product Template
It appears that you would just output them normally [[*myProductOptions]]
Though, it appears that your template is using a placeholder, I would try
[[+cart.myProductOptions] as well. If all else fails you might try debugging the simplecart class and dump the array of product data before it populates the chunk, there might be a clue in there.
Found (through trial and error) you must use:
[[+product.tv.name_of_tv]]

Search for a value and move it to another spreadsheet

I have a little problem using Excel 2010. The problem is simple but I think I start in a wrong direction. Let's say I have a document with the following structure:
<table>
<thead>
<th> Col A</th>
<th> Col B</th>
<th> Col C</th>
</thead>
<tr>
<td> NONE</td>
<td> TEST</td>
<td> NONE</td>
<td> TEST2</td>
<td> TEST3</td>
<td> TEST4</td>
</tr>
<tr>
<td> NONE</td>
<td> TEST</td>
<td> NONE</td>
<td> TEST2</td>
<td> TEST3</td>
<td> TEST4</td>
</tr>
<tr>
<td> TEST</td>
<td> TEST</td>
<td> NONE</td>
<td> TEST2</td>
<td> TEST3</td>
<td> TEST4</td>
</tr>
<tbody>
</tbody>
</table>
I want to search for NONE and move it to another spreadsheet. I want to do this with formula. I tried with SEACH but I don't know how to move it to another spreadsheet.

Resources