<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Andrei Ovcharenko</title>
    <description>The latest articles on DEV Community by Andrei Ovcharenko (@krotname).</description>
    <link>https://dev.to/krotname</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4137854%2Fa1b546a5-5b66-4564-93a2-c55b4be3f9a8.jpg</url>
      <title>DEV Community: Andrei Ovcharenko</title>
      <link>https://dev.to/krotname</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/krotname"/>
    <language>en</language>
    <item>
      <title>Making wide Markdown tables editable in Notepad++</title>
      <dc:creator>Andrei Ovcharenko</dc:creator>
      <pubDate>Tue, 22 Sep 2026 15:09:14 +0000</pubDate>
      <link>https://dev.to/krotname/making-wide-markdown-tables-editable-in-notepad-3di0</link>
      <guid>https://dev.to/krotname/making-wide-markdown-tables-editable-in-notepad-3di0</guid>
      <description>&lt;p&gt;I like Markdown because the source remains readable without a special editor. Tables are the exception.&lt;/p&gt;

&lt;p&gt;A small table is easy to fix by hand. A wide table with long cells, escaped pipes, alignment markers, or mixed Unicode text is not. After changing one value, I would often spend more time repairing spaces and separators than editing the data itself. Tables pasted from CSV, TSV, reports, and generated output made the problem especially visible.&lt;/p&gt;

&lt;p&gt;That is why I built &lt;a href="https://github.com/krotname/NppMarkdownTableEditor" rel="noopener noreferrer"&gt;Markdown Table Editor for Notepad++&lt;/a&gt;, a native C++ plugin that edits pipe tables directly in the document.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F7bml03ekb3mw8ql3844p.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F7bml03ekb3mw8ql3844p.gif" alt="Aligning a Markdown table in Notepad++" width="800" height="515"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  The workflow I wanted
&lt;/h2&gt;

&lt;p&gt;The basic operation is deliberately simple: put the caret anywhere inside a Markdown table and run a command from &lt;code&gt;Plugins &amp;gt; Markdown Table Editor&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;The plugin can:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;align a table once or keep it aligned after edits;&lt;/li&gt;
&lt;li&gt;move between cells and insert, delete, or reorder rows and columns;&lt;/li&gt;
&lt;li&gt;sort body rows by the current column;&lt;/li&gt;
&lt;li&gt;convert the selected CSV/TSV text, or the CSV/TSV block around the caret, into a Markdown table;&lt;/li&gt;
&lt;li&gt;fit a wide table to the visible editor width.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The last command is the part that changed how I work with large tables. Notepad++ word wrap only changes how a long source line is displayed. It does not change the Markdown table, so columns can become visually fragmented. The plugin instead rewrites long cell contents into continuation rows while keeping the table's right edge within the available width where possible.&lt;/p&gt;

&lt;p&gt;When the editor becomes wider again, it can join those continuation rows back together. This makes fitting a table a reversible document transformation rather than a one-way formatting trick.&lt;/p&gt;

&lt;h2&gt;
  
  
  Fitting a table without destroying it
&lt;/h2&gt;

&lt;p&gt;The width algorithm has to balance several constraints:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Parse the table around the caret and preserve its alignment markers (&lt;code&gt;---&lt;/code&gt;, &lt;code&gt;:---&lt;/code&gt;, &lt;code&gt;---:&lt;/code&gt;, or &lt;code&gt;:---:&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;Rejoin rows that look like continuation rows produced by an earlier fit, without merging ordinary sparse rows that merely look similar.&lt;/li&gt;
&lt;li&gt;Measure the natural width of every column and calculate a width budget from the visible Notepad++ editor area.&lt;/li&gt;
&lt;li&gt;Shrink columns with wrappable content toward safe minimums, then distribute any remaining space.&lt;/li&gt;
&lt;li&gt;Wrap cell contents at word boundaries and split a long token only when it cannot fit any other way.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;This is also why display width cannot be treated as &lt;code&gt;std::string::size()&lt;/code&gt;. The core works with UTF-8 and accounts for wide CJK characters, combining marks, variation selectors, and joined emoji sequences when calculating screen columns. Byte length, Unicode code-point count, and terminal/editor display width are different quantities.&lt;/p&gt;

&lt;p&gt;Another small but important case is the escaped pipe. In this row:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight markdown"&gt;&lt;code&gt;| Format | Example |
| --- | --- |
| Markdown | use &lt;span class="sb"&gt;`\|`&lt;/span&gt; inside a cell |
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;the escaped &lt;code&gt;\|&lt;/code&gt; belongs to the cell; it is not a column separator. Parsing and rendering must agree about that or one formatting pass can silently change the table structure.&lt;/p&gt;

&lt;h2&gt;
  
  
  CSV and TSV are not just &lt;code&gt;split(',')&lt;/code&gt;
&lt;/h2&gt;

&lt;p&gt;The conversion command first finds a local delimited block instead of consuming unrelated text above or below the caret. It also ignores delimiters inside quoted CSV fields and handles escaped quotes. Once the rows are parsed, they go through the same Markdown rendering path as tables edited in place.&lt;/p&gt;

&lt;p&gt;Keeping the table transformations in a separate C++ core made these cases testable without driving the Notepad++ UI. The test suite covers parsing, alignment, sorting, CSV/TSV conversion, range detection, escaped pipes, Unicode width, repeated fit/expand cycles, and large generated tables. Performance benchmarks are part of CI as well.&lt;/p&gt;

&lt;h2&gt;
  
  
  Trying it
&lt;/h2&gt;

&lt;p&gt;The plugin is available in the official Notepad++ Plugins Admin:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Open &lt;code&gt;Plugins &amp;gt; Plugins Admin&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Search for &lt;code&gt;Markdown Table Editor&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Install it and restart Notepad++ when prompted.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Version 11.2.0 is available for x86, x64, and ARM64. Release archives, checksums, an SBOM, and build attestations are also available in the &lt;a href="https://github.com/krotname/NppMarkdownTableEditor" rel="noopener noreferrer"&gt;GitHub repository&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;If you work with Markdown tables in Notepad++, I would be interested to hear which table shapes or edge cases are still awkward in real documents.&lt;/p&gt;

</description>
      <category>opensource</category>
      <category>cpp</category>
      <category>markdown</category>
      <category>productivity</category>
    </item>
  </channel>
</rss>
