Table issue

5 views
Skip to first unread message

Jeff M.

unread,
Jun 10, 2010, 7:22:43 PM6/10/10
to Nitrogen Web Framework for Erlang
Sorry, guys, I'm sure that I'm being very dense and can't see the hand
in front of my face right now, but for the life of me I cannot get a
#tablecell to every word wrap and take up more than a single line. I'm
sure it's just a CSS style thing that I'm missing, or a record
property I've missed.

Thanks for any pointers.

Jeff M.

Jesse Gumm

unread,
Jun 10, 2010, 7:24:48 PM6/10/10
to nitro...@googlegroups.com
Try

td {
white-space:nowrap;
}

http://www.w3schools.com/CSS/pr_text_white-space.asp

> --
> You received this message because you are subscribed to the Google Groups "Nitrogen Web Framework for Erlang" group.
> To post to this group, send email to nitro...@googlegroups.com.
> To unsubscribe from this group, send email to nitrogenweb...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/nitrogenweb?hl=en.
>
>

--
Jesse Gumm
Sigma Star Systems
414.940.4866
gu...@sigma-star.com
http://www.sigma-star.com

Jeff M.

unread,
Jun 10, 2010, 8:30:50 PM6/10/10
to Nitrogen Web Framework for Erlang
No, that's the opposite of what I want. I want it to wrap and can't
get it to. :-(

Thanks for the reply, though! I'll look more at that CSS style, too. I
checked before, but didn't see what I needed.

Jeff M.

On Jun 10, 6:24 pm, Jesse Gumm <sigmas...@gmail.com> wrote:
> Try
>
> td {
>     white-space:nowrap;
>
> }
>
> http://www.w3schools.com/CSS/pr_text_white-space.asp
>
>
>
>
>
> On Thu, Jun 10, 2010 at 6:22 PM, Jeff M. <mass...@gmail.com> wrote:
> > Sorry, guys, I'm sure that I'm being very dense and can't see the hand
> > in front of my face right now, but for the life of me I cannot get a
> > #tablecell to every word wrap and take up more than a single line. I'm
> > sure it's just a CSS style thing that I'm missing, or a record
> > property I've missed.
>
> > Thanks for any pointers.
>
> > Jeff M.
>
> > --
> > You received this message because you are subscribed to the Google Groups "Nitrogen Web Framework for Erlang" group.
> > To post to this group, send email to nitro...@googlegroups.com.
> > To unsubscribe from this group, send email to nitrogenweb...@googlegroups.com.
> > For more options, visit this group athttp://groups.google.com/group/nitrogenweb?hl=en.
>
> --
> Jesse Gumm
> Sigma Star Systems
> 414.940.4866
> g...@sigma-star.comhttp://www.sigma-star.com

Jesse Gumm

unread,
Jun 10, 2010, 8:52:51 PM6/10/10
to nitro...@googlegroups.com
Ahh, I completely misread your initial request.

You could try

td {white-space:normal}

and if that doesn't work, try

td{white-space:normal !important}

-Jesse

> For more options, visit this group at http://groups.google.com/group/nitrogenweb?hl=en.
>
>

--
Jesse Gumm
Sigma Star Systems
414.940.4866

gu...@sigma-star.com
http://www.sigma-star.com

Jeff M.

unread,
Jun 11, 2010, 11:08:17 AM6/11/10
to Nitrogen Web Framework for Erlang
That seems to have fixed my problem.. and I feel sheepish for not
having seen it before. Thanks, Jesse.

Jeff M.

Jeff M.

unread,
Jun 14, 2010, 12:24:24 AM6/14/10
to Nitrogen Web Framework for Erlang
Actually, it didn't fix my problem, a short test tricked me into
thinking it did. I think I've discovered the actual problem, and
wondering if anyone has any ideas for me.

I believe the problem is that #literal{}, #span{}, and
wf:html_encode() all convert space (0x20) into &nbsp;. And because of
that, none of the traditional word-wrapping ever happens.

Before I start heading down the path of trying to use regex or
something to take the html encoded string and convert all "&nbsp;"
matches into " ", I figured I'd stop and see if there's another option
available to me that does the encoding but leaves the whitespace
alone.

Thanks all!

Jeff M.

Jesse Gumm

unread,
Jun 14, 2010, 12:38:13 AM6/14/10
to nitrogenweb
Ahh. Yeah, a handful of people have tweaked the framework to remove
the line that converts space to &nbsp;

Comment out or delete line 81 of wf_convert.erl ($\s -> "&nbsp;" ++
html_encode(T);) and it won't encode spaces anymore.

Gotta make your own fork of the codebase, but hey, it works. Just
remember to merge Rusty's changes into your own whenever he deploys a
new version.

-Jesse

Benjamin Nortier

unread,
Jun 14, 2010, 4:23:47 AM6/14/10
to nitro...@googlegroups.com
This is something that should probably go into master, I've had this problem before as well.

I.e. someone should send Rusty a pull request after making the change...

Cheers
Ben
Benjamin Nortier
e: bjno...@gmail.com
c: +44 (0)778 946 1959
gtalk: bjno...@gmail.com

Benjamin Nortier

unread,
Jun 14, 2010, 4:33:19 AM6/14/10
to nitro...@googlegroups.com
Someone = me. I've sent Rusty the pull request

Rusty Klophaus

unread,
Jun 14, 2010, 7:24:07 AM6/14/10
to nitro...@googlegroups.com

jera...@gmail.com

unread,
Jun 14, 2010, 8:57:30 AM6/14/10
to nitro...@googlegroups.com, Jeremy Raymond
What I've done in cases like this is to set the html_encode property to false in the element records and encoded the strings myself leaving the spaces as spaces rather than converting them to non-breaking spaces. Basically copied Nitrogen's encoding function and omitted the space encoding. The function is relatively short and simple.

Sent from my BlackBerry® wireless device
Reply all
Reply to author
Forward
0 new messages