all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Jean Louis <bugs@gnu.support>
To: uzibalqa <uzibalqa@proton.me>
Cc: uzibalqa via Users list for the GNU Emacs text editor
	<help-gnu-emacs@gnu.org>
Subject: Re: Automatically make a table with 16 columns
Date: Fri, 16 Sep 2022 10:26:26 +0300	[thread overview]
Message-ID: <YyQlIjFUDWJPO+SK@protected.localdomain> (raw)
In-Reply-To: <VHpRss1o1UDYQs0-u6a3isv9b01sHjwzXbvs97orF-Pby2gvgCO3Vih6kKbdqd2Pnoqw7G2HjLcYgtv2TdV4teygTbMqFES1OCsbOZ-FNWs=@proton.me>

* uzibalqa <uzibalqa@proton.me> [2022-09-16 03:17]:
> How can I automatically make a table with 16 columns in the current buffer?  
> The first row has numbers from 1 to 15, the second row from 16 to 31.  Followed
> by an additional two rows with entries that are empty.
> 
> Would need it to like like this
> 
> 1  2  3  4  5  6  7  8  9  10 11 12 13 14 15 
> 
> 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
> 
> [16 empty entries]
> 
> [16 empty entries]

(table-insert COLUMNS ROWS &optional CELL-WIDTH CELL-HEIGHT)

C-h f table-insert RET

or user Hyperbole package to invoke following link:

{C-h f table-insert RET}

(progn (insert "\n")
       (table-insert 3 3 4 1))
+----+----+----+
|    |    |    |
+----+----+----+
|    |    |    |
+----+----+----+
|    |    |    |
+----+----+----+

Once you generate your table, populate it:

+----+----+----+
| 1  | 2  | 3  |
+----+----+----+
| 4  | 5  | 6  |
+----+----+----+
|    |    |    |
+----+----+----+

once you have populated it, make function to insert it:

(defun my-table ()
  (interactive)
  (insert "
+----+----+----+
| 1  | 2  | 3  |
+----+----+----+
| 4  | 5  | 6  |
+----+----+----+
|    |    |    |
+----+----+----+
"))

invoke the function:

{M-x my-table RET}

+----+----+----+
| 1  | 2  | 3  |
+----+----+----+
| 4  | 5  | 6  |
+----+----+----+
|    |    |    |
+----+----+----+


-- 
Jean

Take action in Free Software Foundation campaigns:
https://www.fsf.org/campaigns

In support of Richard M. Stallman
https://stallmansupport.org/



  reply	other threads:[~2022-09-16  7:26 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-16  0:16 Automatically make a table with 16 columns uzibalqa
2022-09-16  7:26 ` Jean Louis [this message]
2022-09-16  8:12   ` uzibalqa
2022-09-16  8:42     ` Jean Louis
2022-09-16  9:07       ` uzibalqa
2022-09-16 10:23         ` Jean Louis
2022-09-16 20:46           ` uzibalqa

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YyQlIjFUDWJPO+SK@protected.localdomain \
    --to=bugs@gnu.support \
    --cc=help-gnu-emacs@gnu.org \
    --cc=uzibalqa@proton.me \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.