RedCloth: table with empty value

R

Rodrigo Bermejo

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 /.
 
M

michael.c.morin

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 /.

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,236
Members
46,821
Latest member
AleidaSchi

Latest Threads

Top