You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Tathagat <ma...@tathagat.com> on 2007/07/10 18:15:16 UTC

t:columns and width

Hi. I am trying to set width of my columns in t:datatable where I use
t:columns.

<t:columns width="#{column.width}px">

But it doesn't work (I see no width attribute in corrseponding <TD>). I also
tried the following
<t:columns style="pixelWidth:#{column.width}">

This renders
<TD style=""> (emtpy!!!).

Help please.

Thanks in advance
Tathagat

Re: t:columns and width

Posted by Andrew Robinson <an...@gmail.com>.
Works fine for me.

Test HTML:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html
  xmlns="http://www.w3.org/1999/xhtml">
  <body>
    <table style="table-layout: fixed; margin: 0px; padding: 0px;"
      cellspacing="0" cellpadding="0">
      <tbody>
        <tr>
          <td style="width: 150px;">
            This should be 150
          </td>
          <td style="width: 50px;">
            This should be 50
          </td>
        </tr>
      </tbody>
    </table>
    <div style="position: absolute; width: 150px;
background-color:blue;">&#160;</div>
    <div style="position: absolute; width: 50px; left: 152px;
background-color:green;">&#160;</div>
  </body>
</html>


Tested on firefox 2.0 and IE6

On 7/11/07, Tathagat <ma...@tathagat.com> wrote:
> Good morning.
> I have not doctype in my pages, so I think I am was in quirks mode.
>
> Now I tried with these 2 types:
>
>
> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" >
> and
> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "
> http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
> And with style on t:dataTable
> style="table-layout:fixed;"
>
> Still no effect of width.. (except the table cols have equal width - which
> is ok according to MSDN) I use width both ways on t:columns
> width= "#{column.width}px" style="width:#{column.width}px"
>
> Do you have a working example?
>
> Regards
>
>
>
> On 7/10/07, Andrew Robinson <andrew.rw.robinson@gmail.com > wrote:
> > http://www.quirksmode.org/css/quirksmode.html
> >
> > Also, you probably have to set the "table-layout: fixed;" style in the
> > table so that it uses the columns' width instead of the table's width
> > when computing the actual table width
> >
> > On 7/10/07, Tathagat < mail@tathagat.com> wrote:
> > > I am working on IE 7 and firefox. On both it has no effect. What do you
> mean
> > > by IE compatibility mode and how do I set it?
> > >
> > > Thanks!
> > >
> > >
> > >
> > > On 7/10/07, Andrew Robinson < andrew.rw.robinson@gmail.com> wrote:
> > > > Are you in IE compatibility mode or quirks mode?
> > > >
> > > > I think you have to be compatibility mode for it to work.
> > > >
> > > > On 7/10/07, Tathagat < mail@tathagat.com> wrote:
> > > > > Thanks Andrew.
> > > > > I tried this also.
> > > > > It gives <TD style="width:100px">
> > > > >
> > > > > But it has no effect. I checked MSDN and TD has no width in styles.
> > > > >
> > > > > Any ideas?
> > > > >
> > > > >
> > > > >
> > > > > On 7/10/07, Andrew Robinson < andrew.rw.robinson@gmail.com> wrote:
> > > > > > It should be:
> > > > > >
> > > > > > <t:columns style="width: #{column.width}px;" />
> > > > > >
> > > > > > But odd that it was empty
> > > > > >
> > > > > > On 7/10/07, Tathagat < mail@tathagat.com > wrote:
> > > > > > > Hi. I am trying to set width of my columns in t:datatable where
> I
> > > use
> > > > > > > t:columns.
> > > > > > >
> > > > > > > <t:columns width="#{ column.width}px">
> > > > > > >
> > > > > > > But it doesn't work (I see no width attribute in corrseponding
> > > <TD>). I
> > > > > also
> > > > > > > tried the following
> > > > > > > <t:columns style="pixelWidth:#{ column.width}">
> > > > > > >
> > > > > > > This renders
> > > > > > > <TD style=""> (emtpy!!!).
> > > > > > >
> > > > > > > Help please.
> > > > > > >
> > > > > > > Thanks in advance
> > > > > > > Tathagat
> > > > > >
> > > > >
> > > > >
> > > >
> > >
> > >
> >
>
>

Re: t:columns and width

Posted by Tathagat <ma...@tathagat.com>.
Good morning.
I have not doctype in my pages, so I think I am was in quirks mode.

Now I tried with these 2 types:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
and
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "
http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
And with style on t:dataTable
style="table-layout:fixed;"
Still no effect of width.. (except the table cols have equal width - which
is ok according to MSDN) I use width both ways on t:columns
width="#{column.width}px" style="width:#{column.width}px"

Do you have a working example?

Regards


On 7/10/07, Andrew Robinson <an...@gmail.com> wrote:
>
> http://www.quirksmode.org/css/quirksmode.html
>
> Also, you probably have to set the "table-layout: fixed;" style in the
> table so that it uses the columns' width instead of the table's width
> when computing the actual table width
>
> On 7/10/07, Tathagat < mail@tathagat.com> wrote:
> > I am working on IE 7 and firefox. On both it has no effect. What do you
> mean
> > by IE compatibility mode and how do I set it?
> >
> > Thanks!
> >
> >
> >
> > On 7/10/07, Andrew Robinson <an...@gmail.com> wrote:
> > > Are you in IE compatibility mode or quirks mode?
> > >
> > > I think you have to be compatibility mode for it to work.
> > >
> > > On 7/10/07, Tathagat <ma...@tathagat.com> wrote:
> > > > Thanks Andrew.
> > > > I tried this also.
> > > > It gives <TD style="width:100px">
> > > >
> > > > But it has no effect. I checked MSDN and TD has no width in styles.
> > > >
> > > > Any ideas?
> > > >
> > > >
> > > >
> > > > On 7/10/07, Andrew Robinson <an...@gmail.com> wrote:
> > > > > It should be:
> > > > >
> > > > > <t:columns style="width: #{column.width}px;" />
> > > > >
> > > > > But odd that it was empty
> > > > >
> > > > > On 7/10/07, Tathagat <mail@tathagat.com > wrote:
> > > > > > Hi. I am trying to set width of my columns in t:datatable where
> I
> > use
> > > > > > t:columns.
> > > > > >
> > > > > > <t:columns width="#{ column.width}px">
> > > > > >
> > > > > > But it doesn't work (I see no width attribute in corrseponding
> > <TD>). I
> > > > also
> > > > > > tried the following
> > > > > > <t:columns style="pixelWidth:#{ column.width}">
> > > > > >
> > > > > > This renders
> > > > > > <TD style=""> (emtpy!!!).
> > > > > >
> > > > > > Help please.
> > > > > >
> > > > > > Thanks in advance
> > > > > > Tathagat
> > > > >
> > > >
> > > >
> > >
> >
> >
>

Re: t:columns and width

Posted by Andrew Robinson <an...@gmail.com>.
http://www.quirksmode.org/css/quirksmode.html

Also, you probably have to set the "table-layout: fixed;" style in the
table so that it uses the columns' width instead of the table's width
when computing the actual table width

On 7/10/07, Tathagat <ma...@tathagat.com> wrote:
> I am working on IE 7 and firefox. On both it has no effect. What do you mean
> by IE compatibility mode and how do I set it?
>
> Thanks!
>
>
>
> On 7/10/07, Andrew Robinson <an...@gmail.com> wrote:
> > Are you in IE compatibility mode or quirks mode?
> >
> > I think you have to be compatibility mode for it to work.
> >
> > On 7/10/07, Tathagat <ma...@tathagat.com> wrote:
> > > Thanks Andrew.
> > > I tried this also.
> > > It gives <TD style="width:100px">
> > >
> > > But it has no effect. I checked MSDN and TD has no width in styles.
> > >
> > > Any ideas?
> > >
> > >
> > >
> > > On 7/10/07, Andrew Robinson <an...@gmail.com> wrote:
> > > > It should be:
> > > >
> > > > <t:columns style="width: #{column.width}px;" />
> > > >
> > > > But odd that it was empty
> > > >
> > > > On 7/10/07, Tathagat <mail@tathagat.com > wrote:
> > > > > Hi. I am trying to set width of my columns in t:datatable where I
> use
> > > > > t:columns.
> > > > >
> > > > > <t:columns width="#{ column.width}px">
> > > > >
> > > > > But it doesn't work (I see no width attribute in corrseponding
> <TD>). I
> > > also
> > > > > tried the following
> > > > > <t:columns style="pixelWidth:#{ column.width}">
> > > > >
> > > > > This renders
> > > > > <TD style=""> (emtpy!!!).
> > > > >
> > > > > Help please.
> > > > >
> > > > > Thanks in advance
> > > > > Tathagat
> > > >
> > >
> > >
> >
>
>

Re: t:columns and width

Posted by Tathagat <ma...@tathagat.com>.
I am working on IE 7 and firefox. On both it has no effect. What do you mean
by IE compatibility mode and how do I set it?

Thanks!


On 7/10/07, Andrew Robinson <an...@gmail.com> wrote:
>
> Are you in IE compatibility mode or quirks mode?
>
> I think you have to be compatibility mode for it to work.
>
> On 7/10/07, Tathagat <ma...@tathagat.com> wrote:
> > Thanks Andrew.
> > I tried this also.
> > It gives <TD style="width:100px">
> >
> > But it has no effect. I checked MSDN and TD has no width in styles.
> >
> > Any ideas?
> >
> >
> >
> > On 7/10/07, Andrew Robinson <an...@gmail.com> wrote:
> > > It should be:
> > >
> > > <t:columns style="width: #{column.width}px;" />
> > >
> > > But odd that it was empty
> > >
> > > On 7/10/07, Tathagat <ma...@tathagat.com> wrote:
> > > > Hi. I am trying to set width of my columns in t:datatable where I
> use
> > > > t:columns.
> > > >
> > > > <t:columns width="#{ column.width}px">
> > > >
> > > > But it doesn't work (I see no width attribute in corrseponding
> <TD>). I
> > also
> > > > tried the following
> > > > <t:columns style="pixelWidth:#{column.width}">
> > > >
> > > > This renders
> > > > <TD style=""> (emtpy!!!).
> > > >
> > > > Help please.
> > > >
> > > > Thanks in advance
> > > > Tathagat
> > >
> >
> >
>

Re: t:columns and width

Posted by Andrew Robinson <an...@gmail.com>.
Are you in IE compatibility mode or quirks mode?

I think you have to be compatibility mode for it to work.

On 7/10/07, Tathagat <ma...@tathagat.com> wrote:
> Thanks Andrew.
> I tried this also.
> It gives <TD style="width:100px">
>
> But it has no effect. I checked MSDN and TD has no width in styles.
>
> Any ideas?
>
>
>
> On 7/10/07, Andrew Robinson <an...@gmail.com> wrote:
> > It should be:
> >
> > <t:columns style="width: #{column.width}px;" />
> >
> > But odd that it was empty
> >
> > On 7/10/07, Tathagat <ma...@tathagat.com> wrote:
> > > Hi. I am trying to set width of my columns in t:datatable where I use
> > > t:columns.
> > >
> > > <t:columns width="#{ column.width}px">
> > >
> > > But it doesn't work (I see no width attribute in corrseponding <TD>). I
> also
> > > tried the following
> > > <t:columns style="pixelWidth:#{column.width}">
> > >
> > > This renders
> > > <TD style=""> (emtpy!!!).
> > >
> > > Help please.
> > >
> > > Thanks in advance
> > > Tathagat
> >
>
>

Re: t:columns and width

Posted by Tathagat <ma...@tathagat.com>.
Thanks Andrew.
I tried this also.
It gives <TD style="width:100px">

But it has no effect. I checked MSDN and TD has no width in styles.

Any ideas?


On 7/10/07, Andrew Robinson <an...@gmail.com> wrote:
>
> It should be:
>
> <t:columns style="width: #{column.width}px;" />
>
> But odd that it was empty
>
> On 7/10/07, Tathagat <ma...@tathagat.com> wrote:
> > Hi. I am trying to set width of my columns in t:datatable where I use
> > t:columns.
> >
> > <t:columns width="#{column.width}px">
> >
> > But it doesn't work (I see no width attribute in corrseponding <TD>). I
> also
> > tried the following
> > <t:columns style="pixelWidth:#{column.width}">
> >
> > This renders
> > <TD style=""> (emtpy!!!).
> >
> > Help please.
> >
> > Thanks in advance
> > Tathagat
>

Re: t:columns and width

Posted by Andrew Robinson <an...@gmail.com>.
It should be:

<t:columns style="width: #{column.width}px;" />

But odd that it was empty

On 7/10/07, Tathagat <ma...@tathagat.com> wrote:
> Hi. I am trying to set width of my columns in t:datatable where I use
> t:columns.
>
> <t:columns width="#{column.width}px">
>
> But it doesn't work (I see no width attribute in corrseponding <TD>). I also
> tried the following
> <t:columns style="pixelWidth:#{column.width}">
>
> This renders
> <TD style=""> (emtpy!!!).
>
> Help please.
>
> Thanks in advance
> Tathagat