Google-docs – Insert text box in a Google Docs document

google docs

I am trying to make something like this text box that has a colored background (gray around my code in this example) in Google Docs.

I would like to put some gray box around my code
without any whitespacing - like this!

But it makes me a white spacing between every line. Is there any solution or plugin for this?

Best Answer

Short answer

Use a single cell table and set the cell background to gray.

Instructions

  1. Place the insertion cursor in the location of your document
  2. Click on Table > Insert Table > 1 x 1
  3. Click on Table > Table properties Table properties
  4. Set the line size to 0
  5. Set the background color of the cell
  6. Click on the OK button.
  7. Add the text to the table