I have some CSS I am applying to a view header and view column.
Here is a sample
.viewHeaderName {
width:235px;
background-color:rgb(192,192,192);
color:rgb(0,0,0);
font-family:Trebuchet MS,sans-serif;
font-size:10t;
font-weight:bold;
text-align:left;
}
.viewColumnName {
font-family:Trebuchet MS,sans-serif;
font-size:9pt;
}
Basically I am trying to set the width of the column to what I want. I don't want the text in the header or in the column to wrap. This works perfectly for categorized views for all the columns.
But for simple sorted views, the header is being offset to the right from the text in the column several characters.
If I remove the width parameter in the CSS then everything lines up fine but I don't get the width I want.
you can use td/th nowrap attribute described here
http://www.w3schools.com/tags/att_td_nowrap.asp
or
use white-space element in css described here
http://www.w3schools.com/cssref/pr_text_white-space.asp
white-space:nowrap;
Related
Does anyone know if it is possible to re-position (or set the height of) a footer using PHPWord?
I have a footer exactly as required in terms of text.
$footer = $section->addFooter();
$textrun = $footer->addTextRun();
$textrun->addText('My Footer Text');
However, what I'd like to achieve is to:
Reduce the height of the footer or set the distance from bottom of the page.
There in an option in Word365 called "Footer from bottom", there are also similar options in older versions of Word.
I've tried adjusting the page margins but these appear to be separate from the footer (and header) positioning.
I managed to find a solution by reviewing the GitHub repo.
This commit provides a solution: Added support for page header & page footer height
You can pass the attributes "headerHeight" & "footerHeight" when you create the section that contains your header and footer.
// Adding an empty Section to the document...
$section = $this->_phpWord->addSection(array(
'headerHeight' => 300,
'footerHeight' => 50)
);
$footer = $section->addFooter();
$textrun = $footer->addTextRun();
$textrun->addText('My Footer Text');
There are also some public methods for setting these values after you've created your section, these are: setFooterHeight() and setHeaderHeight().
$section->setHeaderHeight(300);
$section->setFooterHeight(50);
I have a SelectOneMenu component with 2-column select items, like this example: http://primefaces-rocks.appspot.com/ui/selectOneMenu.jsf
How can I remove those borders between the first and the second column?
I'm getting this:
But I would like to get something like this:
I tried with CSS property border-style on column, but it doesn't work. Any suggestion?
Based on a tip from #Tiny, I managed to remove borders with the following CSS code:
.ui-selectonemenu-table td, .ui-selectonemenu-table tr{
border-style: hidden !important;
}
How to change attr width on object, I'm trying with this, but seems does not work...
jQuery('.big').click(function(){
jQuery('#flvPlayer').attr("width", "100");
});
Here is code where I need change height and width on click
<a class="big">100</a>
<textarea><object id="flvPlayer" height="665" width="425"></object></textarea>
Use .css instead of .attr.
jQuery('.big').click(function(){
jQuery('#flvPlayer').css("width", "100");
});
width is a CSS property.
Edit: In textarea you have text. Your <object> is not a HTML element. It is text in your text area.
So, just change the text in textarea.
$('.big').click(function(){
var text = "<object id=\"flvPlayer\" height=\"665\" width=\"100\"></object>"
$("textarea").val(text);
});
Also, I suggest you to use $ instead of jQuery. It's easier and faster to write.
I have a layout where I need to control the line height between wrapped non block level elements:
<p class="payments"><small class="light">You Pay</small><abbr title="GBP">£</abbr>121.50<br><small>per month</small></p>
What I want to achieve is something like:
I don't want to rely on absolute positioning as there will be elements beneath which need to clear this and simply setting a low line-height on he paragraph results in an object which breaks out of its box, see the Fiddle below:
http://jsfiddle.net/mdHKy/2/
Any ideas?
You can first give the p a height then set its line-height to half that amount (being 2 lines).
p.payments {
line-height: 1em;
height:2em;
}
Then set the line-height of small to 1em and give that a vertical-align:
p.payments small {
line-height:1em;
vertical-align:top;
}
Then set the vertical-align of your .light:
p.payments small.light {
vertical-align:baseline;
}
JSFiddle example.
I have a YUI datatable and I am putting the following data in the table:
{key:"name", label:"name", editor: nameChoiceEditor},
{key:"group", label:"group", editor: groupChoiceEditor},
{key:"colony", label:"colony", width: 210, editor: colonyChoiceEditor},
...
Here the name column's width is set to the maximum length of characters entered for that name, and the same with group. colony's column width is set to 210 irrespective of the length of the data.
My problem is when the name column, having multiple words like "odaiah chitukuri", is showing in two lines like so:
odaiah
chitukuri
But when it is one word like "odaiahchitukuri" it is showing in a single line, meaning the column is adjusting to fit the word.
I should have the different words in sigle line. How to do that?
Have the 'breaking' spaces replace with non-breaking spaces.
Try the following:
Change:
{key:"colony", label:"colony", width: 210, editor: colonyChoiceEditor},
To:
{key:"colony", label:"colony", width: 210, editor: colonyChoiceEditor
formatter: function (el, oRecord, oColumn, oData) {
el.innerHTML = oData.replace(/ /g, ' ');
}
},
I'm not sure if your looking for a solution that will always keep the words on a single line.. but generally speaking the datatable does a good job of spacing out the columns correctly based on the content inside. In certain cases though I've definitely had to set the width of a column manually. Here is an example for a column with class appicon:
.yui-skin-sam .yui-dt tbody td.appicon {
width: 40px;
}
Bare in mind once the number of words in the column stretches past it's defined size, it will always move to the next line.
In datatable column define :
will be width:100
not width:"100px"
or width:"100"
or width:"100em"
Use width: 100
like that then its working fine for me