I have converted the pdf into html using pdf2htmlEX. While selecting more than one lines, when cursor goes between two lines the selection jumps upwards. Some one please help to get this fixed.
The issue is already raised here https://github.com/coolwanglu/pdf2htmlEX/issues/62 but the solutions didn't solve the problem. Need help to fix this.
As workaround I have created this styling:
.t {
/* making selection to behave nicer when selecting text between multiple text lines (to avoid element gaps which can cause weird selection behavior) */
padding-bottom: 100px;
margin-bottom: -25px;
/* making selection to behave nicer when selecting text between multiple columns (useful for pages with 2 or more text columns) */
padding-right: 2000px;
}
Problem is that all text elements are absolute positioned and whenever mouse (during selection) leaves text element it fires mouse events on page element (which causes to select text from beginning of page to the starting point) until other text element is reached.
This styling/workaround "fills" those gaps so mouse never reaches page element.
Document should look the same.
Edit: Be aware that this solution relies on proper DOM structure (text elements are ordered). In some scenarios text can become unselectable (eg. when page contains 2 text columns and first text block is actually placed as last child in DOM).
If you get into such problem, try adjusting values to fit nicely in your document, like below:
.t {
/* making selection to behave nicer when selecting text between multiple text lines (to avoid element gaps which can cause weird selection behavior) */
padding-bottom: 40px;
margin-bottom: -10px;
/* making selection to behave nicer when selecting text between multiple columns (useful for pages with 2 or more text columns) */
padding-right: 0px;
}
Selection might jump here and there (again depends on document structure and used values), but still it will be a lot better compared to original state.
Related
I am trying to add padding to all of the cells within my DataGrid (not DataGridView). I want there to be space between the walls of the cell and the text within the cells. Is there any way to do this? I have looked into this and all I see is how to do it with DataGridView and not DataGrid...
Here is a picture of the DataGrid with no padding:
Notice how the the text is pushed tight to the line on the right side.
Please help! Thank you!
This is what worked for me:
I created a CSS file and added left and right padding to td:
td {
padding-left: 5px;
padding-right: 5px;
}
I then added a reference to that CSS file into the same markup file where my DataGrid is located:
<link href="YourFolderNameHere/YourCSSFileNameHere.css" rel="stylesheet" />
I did try what #TnTinMn suggested in his comment with CellPadding but had no luck.
NOTE: I am unsure if this method will work in all cases or only in my own. By doing this all td elements will take this style, which in my case is fine because I wanted all td elements within every table to have this padding style.
I'm trying to programmatically set a dgrid row as active, not just selected. I have a dojo dgrid OnDemandList which is using the Selection and Keyboard Mixins.
Using the select(row) method I can programmatically select a given row, but that row is not active. When a row is active, I can use the Up and Down arrow keys to navigate to the rows above and below it. When a row is just selected, the row is highlighted but the arrows keys do not work.
Clicking the row with the mouse will make it active and selected, but I'm trying to build my interface to be 100% usable with just the keyboard.
Ok, took me awhile but got it figured out. What I was really trying to do was add focus to a row. The code for doing that was in dgrid/Keyboard.js under the _focusOnNode method.
The actual code to change focus from row currentFocusedNode to row focusedNode is:
if(currentFocusedNode){
// Clean up previously-focused element
// Remove the class name and the tabIndex attribute
put(currentFocusedNode, "!dgrid-focus[!tabIndex]");
if(has("ie") < 8){
// Clean up after workaround below (for non-input cases)
currentFocusedNode.style.position = "";
}
}
if(has("ie") < 8){
// setting the position to relative magically makes the outline
// work properly for focusing later on with old IE.
// (can't be done a priori with CSS or screws up the entire table)
focusedNode.style.position = "relative";
}
focusedNode.tabIndex = grid.tabIndex;
focusedNode.focus();
put(focusedNode, ".dgrid-focus");
The code above is really just a code fragment, for it to work you will have to declare "dojo/has" and "put-selector/put" first as well as define the currentFocusedNode and focusedNode. But I'm leaving that as an exercise for the reader ;-)
Also note that this only changes the "focus", it will not select the focusedNode but that can easily be done using grid.select(focusedNode);
I have one grid and text box. I want to highlight values in grid which matches with value in text field.
For example, in firefox, if you press cntrl + F4, you will see one text box and you write a value which you want to find. Firefox hightlights string mathing with this value.
Can we do like this in extjs? How?
There is an example of exactly that here:
http://docs.sencha.com/extjs/4.2.1/extjs-build/examples/grid/live-search-grid.html
Sandeep, the trick to the highlighting is actually in the CSS.
You can navigate to ../examples/ux/css/LiveSearchGridPanel.css to find the following code:
.x-livesearch-match {font-weight: bold; background-color: yellow; }
You can add the CSS href to your index.html, or add this code to your css
Hope this is what you were able to figure out.
I have a textarea in a td element. Currently, when the text area is resized to a width beyond the width of the td element, the entire table resizes to keep the textarea element within the td.
Is there a way to allow the textarea to resize beyond the containing td?
You can add a div with fixed size inside the td around the textarea:
http://jsfiddle.net/kvKZu/4/
(reposting comment as answer)
You can use the max-width and max-height style properties on the textarea. Take a look at:
http://jsfiddle.net/kvKZu/
You can also set them dynamically with javascript if the width and height of the containing row or column is not known in advanced.
I found that applying the style table-layout:fixed to the table fixed this problem.
I created an HTML for email marketing. I placed a table, and applied a border around it:
<table border="0" cellspacing="0" cellpadding="0" style="border:1px solid #982676; margin:0 16px;">
For some reason I am getting 1 pixel extra white space inside when I test it in OUTLOOK 2010. I see it around images that are aligned to the top and to the left, and I see it around other cells that have a solid background color.
See image at this link:screenshot
The top triangle is an image in a cell by itself. The bottom rectangle is a cell with a background color. These were supposes to stick to the border. This is a recurring problem. Has anyone encountered this issue before?
Campaign monitor has a really great solution on how to solve this type of problem. Simple add this style code to your table elements. The code below solved my problem (same as OP) on Outlook 2010
<table align="left" style="border-collapse:collapse; mso-table-lspace:0pt; mso-table-rspace:0pt;"> ... </table>
EDIT: Links have been replaced with wayback machine since both are gone. I also included a gif of the Email on acid version.
http://www.campaignmonitor.com/blog/post/3694/removing-spacing-from-around-tables-in-outlook-2007-and-2010
If that doesn't work, try this.
http://www.emailonacid.com/blog/details/C13/removing_unwanted_spacing_or_gaps_between_tables_in_outlook_2007_2010
I found this here:
http://www.emailonacid.com/blog/details/C13/7_tips_and_tricks_regarding_margins_and_padding_in_html_emails
" Table element margins and padding in Outlook 2007 and 2010 can cause issues
If you add margin or padding properties to your TABLE element, it will add that same margin and padding to every nested TD in Outlook 2007 and 2010. Cellpadding and cellspacing attributes are safe but it's best to avoid CSS margins and padding within the containing TABLE element."
So I guess your margin on the table could be causing this.I m not sure.
In case you haven't found a solution to this problem yet:
Make sure you set border="0" for those images within the table cells.
Add border-collapse:collapse; to the table style.
I solved this problem going into the table properties section and then clicking on "Options". Once the options box appears, change the default cell margins for Left and Right to 0" and then click OK.
For borders of 1 and 3 pixel width, the right border has a 1 pixel space behind it. One solution for this (weird...) kind of problem is a "ghost table" behind the current table, with the width of the current table minus 1 and border of 1.
For example:
<!--[if mso]><table border="1" width="699">
<tr style="display:none;"><td> </td></tr>
</table><![endif]-->
Good luck...