unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* ASCII Tables with row and colspans
@ 2023-10-12 21:05 Ag Ibragimov
  2023-10-13 12:02 ` Ihor Radchenko
                   ` (2 more replies)
  0 siblings, 3 replies; 12+ messages in thread
From: Ag Ibragimov @ 2023-10-12 21:05 UTC (permalink / raw)
  To: emacs-devel


I've driven myself into a self-imposed headache. I need to render an HTML table (Elisp representation of it, result of libxml-parse) in ASCII. Org-mode tables are notorious for their lack of support for spanned columns or rows. Yay, table.el can do it, it's nice for inserting a table and modifying the content interactively. However, it's not really suitable for filling out a table programmatically. There's a `table-insert-sequence` command in table.el that allows you to insert text into a selected cell while automatically adjusting the table, but it's agonizingly slow to call as a function. Sadly, table.el doesn't seem to have a function that could "adjust the table" the way how `org-ctrl-c-ctrl-c` does in org-mode (which, again, doesn't support spans).

Like if I have something like this (that's a parsed example from the Wiktionary):

'(table
    ((style . "background-color:#F0F0F0;width:100%")
     (class . "inflection-table"))
    (tbody
     nil
     (tr
      nil
      (th ((colspan . "2") (style . "background-color:#e2e4c0;")) "infinitive") " "
      (td ((colspan . "6") (style . "text-align:center;")) "conocer"))
     (tr
      nil (th ((colspan . "2") (style . "background-color:#e2e4c0;")) "gerundive") " "
      (td
       ((colspan . "6") (style . "text-align:center;"))
       (span
        ((class . "Latn") (lang . "ast"))
        (a ((href . "/wiki/conociendo#Asturian")
            (title . "conociendo"))
           "conociendo")) " "))
     (tr...)
     (tr...)
     (tr...)
     (tr...)))

What's fast and easy way to render it in ASCII?



^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2023-11-08  6:13 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-10-12 21:05 ASCII Tables with row and colspans Ag Ibragimov
2023-10-13 12:02 ` Ihor Radchenko
2023-10-19  2:13   ` Ag Ibragimov
2023-10-19  3:21     ` Emanuel Berg
2023-10-19  6:46 ` Visuwesh
2023-11-03 10:20 ` Jean Louis
2023-11-03 16:09   ` Emanuel Berg
2023-11-03 19:12     ` [External] : " Drew Adams
2023-11-03 19:27       ` Emanuel Berg
2023-11-04 15:17         ` Eric S Fraga
2023-11-05 15:53           ` Emanuel Berg
2023-11-08  6:13     ` Jean Louis

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).