17

I'm not sure how to describe this without a picture:

enter image description here

Is there a way to do this without drawing the lines manually? Preferably the lines will look as shown.

2 Answers 2

32

You can create a table that includes the label and all the letter slots, then set widths and borders.

For example, suppose you want 9 letter slots:

  1. Create a table with 1 row and 10 columns.
  2. Set the width of the leftmost column wide enough for your label (let's say 3.5 cm).
  3. Set the width for the 9 other columns to 0.5 cm.
  4. Remove the top, left and bottom borders from the left cell.
  5. Remove the top border from the other 9 cells.

And there you have it:

enter image description here

This is what it looks like in Print Preview:

enter image description here

The advantage of this method is that the user can move from cell to cell using the Tab key, and also cannot accidentally break the structure.

3
  • 2
    In addition, you might even be able to write a small script that automatically jumps from one cell to the next based on user input.
    – Nzall
    Jun 1, 2016 at 9:15
  • 5
    I was assuming this was for a printed form, otherwise surely using the developer tools and making an actual form would be better? No one likes having their ability to cut and paste removed when completing an electronic form.
    – Paul
    Jun 1, 2016 at 13:25
  • if you want the vertical lines to have half of the height, you can split the cells into 2 rows, the label span across 2 rows, and set no border for the first row. the outcome will be more similar as the image provided by op.
    – wilson
    Jun 3, 2016 at 2:22
15

You can do this with unicode chars.

Title: ┗━┻━┛

This is a left box, a middle bit and a right box corner, with a bottom bit to widen it. You get this holding Alt and hitting the keys on the number pad. Note that this must be done in an Office app or one that supports Unicode codepoints (otherwise the 4 digit code will be modulo 256 and so wrapped to a number less than 256).

┗ : 9495

┻ : 9531

┛ : 9499

━ : 9473

Or you can just cut and paste from here.

12
  • Is there really no better way to do it?
    – MathMajor
    Jun 1, 2016 at 6:36
  • 9
    How would you qualify "better"?
    – Paul
    Jun 1, 2016 at 6:40
  • 27
    On the "terminal ages" we used ASCII art, now we use Unicode art. History repeats itself.
    – totymedli
    Jun 1, 2016 at 8:41
  • 1
    Are the characters language dependant? Using my UK keyboard, I get this output, ↨;←☺
    – TMH
    Jun 1, 2016 at 14:49
  • 2
    @TomHart Traditionally, Windows has interpreted the number in alt codes as modulo 256, so Alt+9495 would be the same as Alt+23, which would be your first arrow in the default codepage. Microsoft Office programs (and Wordpad) will interpret numbers larger than 256 as a Unicode codepoint. What actually happens when you type an alt code is highly platform and program-dependent.
    – isanae
    Jun 1, 2016 at 17:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.