XPATH: Finding rows that contain multiple texts - xpath

Im not sure why but the below query
.//*[#id='training_modules_list_table']/thead/tr[th[text()='ID']and th[text()='NAME']and th[text()='STATUS']and th[text()='VERSION']and th[text()='PACKAGE']and th[text()='REFERENCE']]
does not find anything in the html below.
<table class="table sortable stripe tablesaw-stack" data-tablesaw-mode="stack" id="training_modules_list_table">
<thead>
<tr>
<th data-sort="int">ID</th>
<th data-sort="string">Name</th>
<th data-sort="string">Status</th>
<th data-sort="string">Version</th>
<th data-sort="string">Package</th>
<th>Assigned Study</th>
<th data-sort="string">Reference</th>
<th data-sort="string"></th>
</tr>
</thead>
<tbody>
<tr>

While your question has less information that what actually you want to achieve but after seen your xpath it looks you are trying to write a xpath which return you all a tag element.
Try below xpath :-
//table[#id='training_modules_list_table']//tr/th/a
It will return you all element in a tag
Hope it will help you :)

Related

laravel 9 Update, change a field of all rows with the same reference

I ask if anyone can help me, I import an excel table and create several rows of data with a column with the same reference, I want to update a field with a single input of all the rows with the 'Same' reference, for example I want to change the value of the same column with a single input and update the data to all, or add if it does not exist
<table class="table">
<thead>
<tr>
<th scope="col">#</th>
<th scope="col">First</th>
<th scope="col">Last</th>
<th scope="col">Same</th>
</tr>
</thead>
<tbody>
<tr>
<th scope="row">1</th>
<td>Mark</td>
<td>Otto</td>
<td>255</td>
</tr>
<tr>
<th scope="row">2</th>
<td>Jacob</td>
<td>Thornton</td>
<td>255</td>
</tr>
<tr>
<th scope="row">3</th>
<td>Larry</td>
<td>the Bird</td>
<td>255</td>
</tr>
</tbody>
</table>

Formating View in maatwebsite Excel Export

I am new to maatwebsite Excel Export i am using view Excel Export in laravel and would like to know how one can specify the cell number where the data should go like a h1 tag like below snippet
<h5>PURCHASE ORDER</h5>
<hr>
<div class="container-flow">
<table id="table" class="table table-hover table-bordered table-sm text-center">
<thead>
<tr>
<th scope="col">No.</th>
<th scope="col">Product_Code</th>
<th scope="col"> Item_Description </th>
<th scope="col">Qty</th>
<th scope="col">Unit Price</th>
<th scope="col" >Value</th>
<th scope="col">Stock Less 90 Days</th>
<th scope="col">Stock More 90 Days</th>
when i export i get this
i would like to specify the cell where that tag should go like say cell B3 instead of current position cell A1
You can put some empty tags / cells before.
Try
<table>
<tr></tr>
<tr></tr>
<tr>
<td></td>
<td></td>
<td><h5>PURCHASE ORDER</h5></td>
</tr>
</table>
<hr>
<div class="container-flow">
<table id="table" class="table table-hover table-bordered table-sm text-center">
<thead>
<tr>
<th scope="col">No.</th>
<th scope="col">Product_Code</th>
<th scope="col"> Item_Description </th>
<th scope="col">Qty</th>
<th scope="col">Unit Price</th>
<th scope="col" >Value</th>
<th scope="col">Stock Less 90 Days</th>
<th scope="col">Stock More 90 Days</th>

How to convert html to pdf using shell script

I have written html in shell script and saving that output to output.html and i want convert that output.html to output.pdf and to output.json how to do that?
<table class="table table-sm">
<thead>
<tr>
<th scope="col">#</th>
<th scope="col">First</th>
<th scope="col">Last</th>
<th scope="col">Handle</th>
</tr>
</thead>
<tbody>
<tr>
<th scope="row">1</th>
<td>Mark</td>
<td>Otto</td>
<td>#mdo</td>
</tr>
<tr>
<th scope="row">2</th>
<td>Jacob</td>
<td>Thornton</td>
<td>#fat</td>
</tr>
<tr>
<th scope="row">3</th>
<td colspan="2">Larry the Bird</td>
<td>#twitter</td>
</tr>
</tbody>
</table>
to convert the file in PDF you may need the utility to be installed
Follow this link to get this done
once you install the same, using the link mentioned run this
html2pdf filename

How to select few columns by default in jQuery Bootgrid

I am trying to use http://www.jquery-bootgrid.com/examples#data-api
When table is loaded from SQL database, all columns show up as all check boxes are marked in drop down menu (image attached), I want that only selected columns show up by defult and user can mark the the realted column field in check box to make it visible.
.Image here
<table id="employee_grid" class="table table-condensed table-hover table-striped" width="70%" cellspacing="0" data-toggle="bootgrid">
<thead>
<tr>
<th data-column-id="id" data-type="numeric" data-identifier="true">id</th>
<th data-column-id="own_referrer">O_Refferer</th>
<th data-column-id="own_aact_status">own_aact_status</th>
<th data-column-id="rate">rate</th>
<th data-column-id="text_Details">text_Details</th>
<th data-column-id="remarks">remarks</th>
<th data-column-id="commands" data-formatter="commands" data-sortable="false">Commands</th>
</tr>
</thead>
</table>
found the solution. Just add ( data-visible="false" ) (without brackets) to the respective th line in table.
<table id="employee_grid" class="table table-condensed table-hover table-striped" width="70%" cellspacing="0" data-toggle="bootgrid">
<thead>
<tr>
<th data-column-id="own_referrer" data-visible="false">O_Refferer</th>
<th data-column-id="own_referrer">O_Refferer</th>
<th data-column-id="own_aact_status">own_aact_status</th>
<th data-column-id="rate">rate</th>
<th data-column-id="text_Details">text_Details</th>
<th data-column-id="remarks">remarks</th>
<th data-column-id="commands" data-formatter="commands" data-sortable="false">Commands</th>
</tr>
</thead>
</table>

Using Bootstrap Labels in Bootstrap tables

I'm trying to add a bootstrap label to a <th> field I have in bootstrap-table that I have so that I can get the results of the fields to display in a label. What's the best way to approach this? Putting the <span> inside the <th> doesn't yield the desired result. I'd just like the results to be labels - is this possible?
<table id="medicationtable">
<thead>
<tr>
<th data-field="Medication_Name">Medication Name</th>
<th data-field="Read_Code">Read Code</th>
<th data-field="Dose">Dose</th>
<th data-field="Date_Started">Date Started</th>
<th data-field="Date_Ended">Date Ended</th>
</tr>
</thead>
</table>
I don't think it's possible if you're generating the table from remote data. If you want to add additional html into the cells generated, you'd need to apply bootstrap-table to an already existing table in the html.
http://issues.wenzhixin.net.cn/bootstrap-table/#options/from-html.html

Resources