How to change width of

Tags: css,jsf-2,primefaces,width,panelgrid

Problem :

I have a <p:panelGrid> as follows:

<p:panelGrid style="width: 50px">
        <p:column colspan="2">

I tried to set the width of the panel grid to 50px by setting the CSS width property, however it didn't become 50px wide.

How can I set the width of the panel grid to 50px?

Solution :

The <p:inputTextarea> is wider than the <p:panelGrid> and therefore pushing it far outside the specified width.

You need to set the width on the <p:inputTextarea> as well.

<p:inputTextarea style="width: 50px;" />

(note: this doesn't take margins into account, so the panel grid is still a bit larger than 50px, but you should now know how to finetune that)

Unrelated to the concrete problem, CSS should go in its own .css file.

    CSS Howto..

    How can I include CSS in php?

    Problems with jQuery Image Slideshow / Rotating Banner using timeout / interval

    How to right align text but still keep it indented to left?

    How to send web page in email body with css

    How to get the rotation of degree with getBoundingClientRect?

    How to disable [marquee] tag with CSS? Is this possible?

    how to remove elements in document fragment after append

    In CSS, how to toggle the tab color if it was selected (without using javascript)

    How can I line up my CSS DIVs

    How to grows up a div height with a table that has your rows added dynamically?

    How to change the width of displayed text nested in a div?

    How to change width of

    jQuery UI how to avoid submit button getting css classes?

    Rollover table shows hidden span class text with css

    How Do I Reduce the Padding Around a Chart Within an Article

    How can I create a nav bar with a repeat image inside?

    How to create a darker background on a whole page with one new div

    CSS: How to use calc(100% - 20px) to get an area to fill up all area OTHER than that of a fixed-width element?

    How to add a shadow for underline (bottom border) in css

    How to make scrollbars appear when DIV doesn't have enough room but keep DIV centered?

    How to put a space between the hover effect in this situation css html php?

    How to make text and icons black in sticky header?

    How to prevent opening multiple popup windows?

    How to change visibility of Calendar on textbox click

    How to hide a div class in Wordpress? CSS

    How to create this style of nav bar using exclusively HTML5 and CSS?

    CSS img align: how to set a img middle-right align in a DIV

    How to reset css (a:visited{color:green}) when refresh browser address bar

    How to include display:block in css code that includes pseudo element 'before'

    How to reload CSS when using Less.js