WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is it possible to make a shortcode for table which can include commas and linebreaks for its content? I've been trying to output something like this with shortcode:

enter image description here

But it seems difficult. I tried Google and found this and there, but what given there don't seem to allow commas within the content (as it is separated by comma) and can't seem to have linebreaks.

Is this actually possible? Or is there any viable alternatives to achieve this? I'm avoiding using plugin, only tried to mingle around with functions.php.

Thanks a lot for the help. :)

share|improve this question
There are a lot of plugins that add tables or grid layout columns to posts and the backend editor, a quick google search should point them out =p – Tom J Nowell Oct 1 '12 at 15:12
@TomJNowell: I'm avoiding plugin, and I tried Google search :) – deathlock Oct 2 '12 at 0:57
Why is this closed? There is a similar questions dropped here: wordpress.stackexchange.com/questions/17187/… I'm not asking for a plugin recommendations. I just need something to be put inside functions.php. – deathlock Oct 2 '12 at 0:59
Please provide example how do you envision shortcode will be written/used. Before logic can explained to computer, it needs to be understodd by human doing the explaining. :) – Rarst Oct 2 '12 at 12:10

Shortcodes don't need to take the form [shortcodename attribute="val1,val2"], they can also take the form [shortcode]stuff,stuff2,stuff3[/shortcode].

You could use a plugin that makes use of such shortcode, such as this:


enter image description here

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.