# RedCloth: table with empty value

**URL:** <https://www.ruby-forum.com/t/redcloth-table-with-empty-value/141635>\
**Category:** Ruby\
**Created:** [June 28, 2008, 1:33am UTC](https://www.ruby-forum.com/t/redcloth-table-with-empty-value/141635 "2008-06-28T01:33:35Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![rbermejo](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/9de0a6/32.png) [@rbermejo](https://www.ruby-forum.com/u/rbermejo)\
**Post date:** [June 28, 2008, 1:33am UTC](https://www.ruby-forum.com/t/redcloth-table-with-empty-value/141635/1 "2008-06-28T01:33:35Z")

</div>

Hello List /.

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

require ‘redcloth’  
table = RedCloth.new("|a|b|c|d|\n|A||c|d|").to\_html  
puts table  
  
produces:

| a | b | c | d |
| A | c | d |

Do you know how can I represent an empty value in a table ?  
Thank you /.

---

<div class="post-metadata">

**Author:** ![rbermejo](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/9de0a6/32.png) [@rbermejo](https://www.ruby-forum.com/u/rbermejo)\
**Post date:** [June 28, 2008, 9:55pm UTC](https://www.ruby-forum.com/t/redcloth-table-with-empty-value/141635/2 "2008-06-28T21:55:48Z")

</div>

On Jun 27, 7:31 pm, Rodrigo B. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> produces:  
> d
> 
> ## 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 M.  
Guide to Ruby

> **[Ruby Programming](https://www.thoughtco.com/ruby-programming-4133469)**
>
> Learn the Ruby programming language with simple, step-by-step tutorials.

Become an [About.com](http://About.com) Guide: [beaguide.about.com](http://beaguide.about.com)  
[About.com](http://About.com) is part of the New York Times Company
