Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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
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 Oct 2 '12 at 12:10
add comment

1 Answer

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:

http://wordpress.org/extend/plugins/easy-table/

enter image description here

share|improve this answer
add comment

Your Answer

 
discard

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.