Footable - client wants column width to remain constant between pages - pagination

When you have multiple pages of data in a Footable, the column width changes as you page through the data, depending on what appears in each column at any given time. This is ugly.
I think my client's request means I will not have responsive tables, but maybe there is way out of this that I don't see.
Footable handles pagination client-side. Technically, it should be possible to "lock" the column width from the first page and force it to remain the same throughout the data. I don't think Footable has this option, though.
$(function () {
$('.footable').footable();
});
This jsfiddle illustrates the issue (the jsFiddle CSS interferes with mine a bit because it has Footable classes, too).
I could specify the width of the columns in % - that seems to work even when column are hidden as the viewport shrinks.
Does anyone have another/better suggestion?

I am not able to reproduce your problem and the jsfiddle is not paging the footable.
Still, I had a similar problem with column width when I generated the table content after an AJAX call. The solution I found was to apply a class to every cell in the nTH column and then define the width = max-width min-width.
I've added a class to your subject header and defined css for this column ...
http://jsfiddle.net/bgil2012/gHsdE/
<table class="footable" data-page-size="5">
<thead>
<tr>
<th data-toggle="true">Product</th>
<th data-hide="phone">Study Id</th>
<th class="study-title" data-hide="phone">Study Title</th>
<th class="column_condition" >Condition</th>
<th>Results</th>
<th></th>
</tr>
</thead>
<tbody>
<tr>
<td>Tysabri</td>
<td>001-06-NAT</td>
<td class="study-title">ENER-G Tysabri fatigue and cognition</td>
<td class="column_condition" >Multiple Sclerosis</td>
<td>CSR Synopsis</a>
</td>
</tr>
CSS:
.study-title {
max-width: 20px;
min-width: 20px;
width: 20px;
}

Related

Hiding unfilled fields in pdf/html templates via source code

I'd like to make certain fields invisible/disappear when remain unfilled.
i.e. Email:
This will result in the email text field not being printed out
Here is an example of how I do that. It's a custom field, on mine, but the logic is the same. The ?has_content piece is what tests for data in the field.
<#if record.custbody_bill_to_email?has_content>
<tr>
<td style="width: 147px;"><span style="font-size:10px;"><strong>Email</strong></span></td>
<td style="width: 175px;"><span style="font-size:11px;">${record.custbody_bill_to_email}</span></td>
</tr>
</#if>

Initialize from html table

I have been trying to make an org chart using the code from this example http://www.getorgchart.com/Demos/Initialize-From-HTML-Table
I am making my table dynamically from xml data (planning to do this for many different xml files so thats why I haven't hardcoded the table). The result does not look right and I'm not sure whats going wrong. I suspect that maybe its trying to make the org chart before my table is made. I have no console errors and I get a plain blue screen with the search bar and arrows when I try to run everything.
Here is my html code:
https://pastebin.com/6b1d0gEC
<body onload="getXML()">
<div id = "conditions"></div>
<div style="float: right; width: 10%; height:100%; text-align:center; display: none;" ></div>
<table id="orgChartData" >
<tr>
<th>title</th>
</tr>
<tr>
Here is my JS code
https://pastebin.com/c7fFerqH
Here is the XML im using to generate the table
https://pastebin.com/0k3xQ5Th

Replace Woocommerce Attribute name with an icon or an image

I'm using the Divi theme along with WC.
I have created 3 product attributes for my tea shop.
I wish to display an image on the front end rather that the name (or label) of the attribute.
For instance, instead of reading Steeping Temperature, I would like to display the image of a thermometer.
I am not a programmer / developper.
Please help
Steph
it is posible to use
after
in css for add an icon to each title of attributes.
#attribute45896{
content:" ";
background-image:url('http://rapido.ir/wp-content/uploads/2017/02/blue.png');
background-size:30px;
background-position:left center;
background-repeat:no-repeat;
padding-left:40px}
<table>
<tbody>
<tr class="alt">
<th id="attribute45896">color:</th>
<td><ul class="jcaa_attr_select jcaa_size_small jcaa_rounded_corners">
<li style="list-style:none;">red
</li>
</ul>
</td>
</tr>
</tbody>
<table>
but woocommerce do not set an auto id or random class to attributes.

JavaFX hide text of column in tableview

I have a tableview and I want to show an image in the first column. My problem is I can't sort the column then. My idea is to set text in the column too and hide the text so it is only for the correct sorting set. Is there a way to do that? Or what other solutions are possible for my problem?
I think this is the perfect example what you wants to do.Still let me know if you have any issue.
Check here
I would have a look at TableColumn.setCellValueFactory() and TableColumn.setCellFactory(). The further is used to provide the actual cell value (used for sorting!), the latter is used to provide the rendering.
In other words: If you need the sort order, you must not change the content, but only the Cell rendering. The methods mentioned above let you do exactly this.
Hope that helps ...
You could do it with just CSS using text-indent. You would also need to set the image as a css background. You did not provide an code of your table, but below is some example:
HTML:
<table width="100%" border="1" cellspacing="1" cellpadding="1">
<tr>
<td class="hidetext image">Text 1</td>
<td>Some text to show</td>
</tr>
<tr>
<td class="hidetext image">Text 2</td>
<td>Some text to show</td>
</tr>
<tr>
<td class="hidetext image">Text 3</td>
<td>Some text to show</td>
</tr>
<tr>
<td class="hidetext image">Text 4</td>
<td>Some text to show</td>
</tr>
</table>
CSS:
.hidetext {text-indent:-9000px}
.image {background:url(http://www.madisoncopy.com/images/jpeg.jpg) no-repeat;}
See how in the left column the text does not show (but it is actually there just indented off the screen).
See this fiddle: http://jsfiddle.net/D297P/

Watir: How to access a table without an ID or NAME

I am trying to write my watir script to grab the following data (the table body headers and the table row data, but I am having trouble trying to figure out how to access the table. (Once I get that, teh rest is a piece of cake).
Can anyone come up with something that will help me access the table? It doesn't have a name or an ID...
<div id="income">
<table class="tHe" cellspacing="0">
<thead>
<tr>
<th id="companyLabel" class="tFirst" style="width:30%"> Quarter Ending </th>
<th id="201004" class="tFirst right">Apr 10 </th>
<th id="201001" class="tFirst right">Jan 10 </th>
<th id="200910" class="tFirst right">Oct 09 </th>
<th id="200907" class="tFirst right">Jul 09 </th>
<th id="200904" class="tFirst right">Apr 09 </th>
</tr>
</thead>
<tbody id="revenueBody">
<tr>
<td class="indtr">Totals</dfn></td>
<td class="right">2849.00</td>
<td class="right">3177.00</td>
<td class="right">5950.00</td>
<td class="right">4451.00</td>
<td class="right">3351.00</td>
</tr>
...
ie.table(:class=>'tHe') should work if there's no other tables with the same class name
ie.table(:after?, ie.div(:id, 'income')) should work if there's no other div with id 'income'
or ie.table(:index=>0) - you would need to check your page to see what the correct index value for your table is.
But wait, there is more! :)
browser.div(:id => "income").table(:class => 'tHe')
browser.div(:id => "income").table(:index => 1)
...
There is also XPath if you are stuck.
If you fire up the page and access it through Firebug or your browser's native developer tools, you can find the xpath expression for the table and then plug that into the Watir API call.
I think it was in later versions of Watir 1.5.x that support for advanced page querying came in (basically your problem, where there are no ID tags). This page on the watir wiki should help:
Ways Available To Identify HTML Element

Resources