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. :)

  • 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
    Commented Oct 1, 2012 at 15:12
  • @TomJNowell: I'm avoiding plugin, and I tried Google search :)
    – deathlock
    Commented Oct 2, 2012 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
    Commented Oct 2, 2012 at 0:59
  • 1
    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
    Commented Oct 2, 2012 at 12:10

1 Answer 1


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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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