noob123
noob123

Reputation: 11

Aligning left and right on the same line in WordPad

Is it possible to align texts left and right on the same line in WordPad? For example, I want my name to the left and the date to the right. Both on the same line. How can I do this?

Upvotes: 1

Views: 3892

Answers (2)

Zarat
Zarat

Reputation: 2754

While WordPad does not allow you to modify the alignment of tab stops the RTF format supports tab stops with alignments and WordPad can display and edit documents containing such tab stops, for example when you create them in Microsoft Word and save as RTF.

If you don't have access to Microsoft Word you can create the tab stops in WordPad, save the file as RTF, then open it with a text editor and modify the tab stop definitions you are interested in.

Here is an example:

I created a simple RTF document in WordPad which contains the text Left<tab>Middle<tab>Right and created two tab stops. I want the first tab stop to align centered and the second tab stop to align right.

Then I save the document in RTF format on my desktop and open it in notepad. It looks like this:

{\rtf1\ansi\ansicpg1252\deff0\nouicompat\deflang1031{\fonttbl{\f0\fnil\fcharset0 Calibri;}}
{\*\generator Riched20 10.0.14393}\viewkind4\uc1 
\pard\sa200\sl276\slmult1\tx3976\tx7242\f0\fs22\lang7 Left\tab Middle\tab Right\par
}

Notice the \tx3976 and \tx7242 commands which define the tab stop positions (generally you look for \tx followed by some number).

Now you can insert the \tqc command for center-aligned tabstops or the \tqr command for right-aligned tabstops. You enter that command in front of the \tx command you want to modify. The RTF document now looks like this:

{\rtf1\ansi\ansicpg1252\deff0\nouicompat\deflang1031{\fonttbl{\f0\fnil\fcharset0 Calibri;}}
{\*\generator Riched20 10.0.14393}\viewkind4\uc1 
\pard\sa200\sl276\slmult1\tqc\tx3976\tqr\tx7242\f0\fs22\lang7 Left\tab Middle\tab Right\par
}

Now you can save the document and exit notepad, when you reopen the file in WordPad you should see it displaying with the correct tab stop alignments. It is also possible to move the tab stops around in WordPad without losing the alignments.

Tested on Windows 10 but it probably will work on earlier versions of WordPad since the required commands are not exactly new.

Upvotes: 1

Oliver W.
Oliver W.

Reputation: 13459

It's not possible using proper formatting.

For example, in Microsoft Word/LibreOffice Writer you'd use left- and right-aligning tabs, as demonstrated in this howto for Word. However, WordPad only has left-aligning tabs.

It is possible to fake it, as it was done in the old days (and still now, by those who don't know better), by clever usage of spaces (or a mix of spaces and tab stops).

Upvotes: 0

Related Questions