Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > RedCloth: table with empty value

Reply
Thread Tools

RedCloth: table with empty value

 
 
Rodrigo Bermejo
Guest
Posts: n/a
 
      06-27-2008
Hello List /.

I am trying to build a html table from a string using RedCloth.
My table should show some empty values
<code>

require 'redcloth'
table = RedCloth.new("|a|b|c|d|\n|A||c|d|").to_html
puts table
</code>
produces:
<table>
<tr>
<td>a</td>
<td>b</td>
<td>c</td>
<td>d</td>
</tr>
<tr>
<td>A</td>
<td>c</td>
<td>d</td>
</tr>
</table>

Do you know how can I represent an empty value in a table ?
Thank you /.
--
Posted via http://www.ruby-forum.com/.

 
Reply With Quote
 
 
 
 
michael.c.morin@gmail.com
Guest
Posts: n/a
 
      06-28-2008
On Jun 27, 7:31*pm, Rodrigo Bermejo <(E-Mail Removed)> wrote:
> Hello List /.
>
> I am trying to build a html table from a string using RedCloth.
> My table should show some empty values
> <code>
>
> require 'redcloth'
> table = RedCloth.new("|a|b|c|d|\n|A||c|d|").to_html
> puts table
> </code>
> produces:
> <table>
> * * * * * * * * <tr>
> * * * * * * * * * * * * <td>a</td>
> * * * * * * * * * * * * <td>b</td>
> * * * * * * * * * * * * <td>c</td>
> * * * * * * * * * * * * <td>d</td>
> * * * * * * * * </tr>
> * * * * * * * * <tr>
> * * * * * * * * * * * * <td>A</td>
> * * * * * * * * * * * * <td>c</td>
> * * * * * * * * * * * * <td>d</td>
> * * * * * * * * </tr>
> </table>
>
> Do you know how can I represent an empty value in a table ?
> Thank you /.
> --
> Posted viahttp://www.ruby-forum.com/.


Force empty cells to span 1 column with \1. In my test the cell
contains a space, if that's "empty" enough.

puts RedCloth.new("|a|b|c|d|\1|A||c|d|").to_html

--
Michael Morin
Guide to Ruby
http://ruby.about.com/
Become an About.com Guide: beaguide.about.com
About.com is part of the New York Times Company
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Altova Mapforce - xml 2 xml map: empty elements output although input element is not empty Lukas XML 3 11-10-2005 02:25 PM
empty lists vs empty generators Brian Roberts Python 12 05-04-2005 08:59 PM
Easy way to output a default value if <xsl:value-of/> selection comes back empty? Michael Ahlers XML 1 07-12-2004 05:17 PM
Check if a directory is empty and empty it Marcia Hon C Programming 8 02-14-2004 03:53 AM
empty/non-empty element John XML 1 07-16-2003 10:23 AM



Advertisments