Questions tagged [padding]

Extra space inserted into memory structures to achieve address alignment -or- extra space between the frame and the content of an HTML element -or- extra spaces or zeros when printing out values using formatting print commands like, in C, the printf*-family of functions.

Padding in memory structures is the insertion of additional bytes of unused space to make the internal fields of a structure align to desirable address boundaries.

Padding in HTML layout is extra space inserted between the content of the element and its border or frame. Padding is space added to the interior of the element; margin is space around the exterior of the element.

In arrays, padding is addition of extra 0's (zeros) in one or more dimension of the array in a symmetric, circular or replicating manner. This is important for signal and image processing, in the context of and convolution.

3517 questions
67
votes
6 answers

How to add padding-left on a UIButton created programmatically?

I am having a trouble adding left padding on a UIButton. I have a UIButton with UIControlContentHorizontalAlignmentLeft. I want the text to be displayed on the left side but it is too left. when I give the border, it doesn't look good. I would like…
MissStack
  • 773
  • 1
  • 5
  • 6
65
votes
14 answers

Padding stl strings in C++

I'm using std::string and need to left pad them to a given width. What is the recommended way to do this in C++? Sample input: 123 pad to 10 characters. Sample output: 123 (7 spaces in front of 123)
Alex B
  • 23,784
  • 13
  • 60
  • 84
65
votes
14 answers

How to remove the top and bottom space on textview of Android

When I include the below XML to layout file, I can see the below image. If you see it, you could realize that the TextView has top and bottom space.…
mooongcle
  • 3,728
  • 5
  • 29
  • 41
65
votes
12 answers

How do you specify table padding in CSS? ( table, not cell padding )

I have a table with a colored background and I need to specify the padding between the table and it's content, I.E. cells. The table tag doesn't seem to accept a padding value. Firebug shows the table and tbody's layout with padding 0 but doesn't…
Petruza
  • 10,275
  • 24
  • 74
  • 121
61
votes
11 answers

No padding when using overflow: auto

I can't get padding-bottom to work when I use overflow-y: auto on a box. HTML:
CSS: #container { padding: 3em; overflow-x: hidden; overflow-y: auto; width: 300px; …
Philip
  • 5,950
  • 12
  • 66
  • 99
60
votes
7 answers

How to increase the distance between table columns in HTML?

Let's say I wanted to create a single-rowed table with 50 pixels in between each column, but 10 pixels padding on top and the bottom. How would I do this in HTML/CSS?
idude
  • 3,956
  • 6
  • 27
  • 41
59
votes
4 answers

Android TextView drawable, change padding between drawable and text?

I am creating a TextView with a drawable underneath, in a GridLayout. I want to bring the drawable to the middle of the TextView; I tried with setCompoundDrawablePadding(-75) and it only changes the position of the text. Current code: TextView…
user1648374
  • 595
  • 1
  • 4
  • 8
58
votes
4 answers

Pad left or right with string.format (not padleft or padright) with arbitrary string

Can I use String.Format() to pad a certain string with arbitrary characters? Console.WriteLine("->{0,18}<-", "hello"); Console.WriteLine("->{0,-18}<-", "hello"); returns -> hello<- ->hello <- I now want the spaces to be…
Boris Callens
  • 82,870
  • 79
  • 201
  • 297
55
votes
11 answers

Does bootstrap have builtin padding and margin classes?

Does Bootstrap have built-in padding and margin classes like pad-10, mar-left-10 or I have to add my own custom classes? For example, similar to the ones here at padding and margin tabs.
Ozgur Erdogan
  • 793
  • 1
  • 6
  • 9
54
votes
8 answers

Add "padding" to a UITextView

as the title says i am trying to add padding-like behavior to a UITextView. The textview is generated when the view is pushed inside my navigation controller and the following code occurs: self.textView.layer.cornerRadius = 7; //pretty stuff is…
magtak
  • 890
  • 1
  • 9
  • 20
54
votes
3 answers

CSS Div width percentage and padding without breaking layout

There may be a simple fix for this, but it has troubled me for ages now... Let me explain the situation. I have a div with the ID 'container' that holds all the contents in the page (including header and footer also) that will keep everything…
Kyle Ross
  • 1,971
  • 4
  • 19
  • 26
54
votes
4 answers

Padding not working on ImageButton

In an app I am working on, I have several ImageButtons. Each ImageButton has a background and content in the form of a drawable. Right now the drawable is at maximum size within the confines of the ImageButton, but I want it to scale down so I need…
Zero
  • 1,754
  • 3
  • 19
  • 37
50
votes
7 answers

How to remove padding around Android CheckBox

I need to put check to the right hand top corner of my imageview. But when I do this I noticed a default margin around my checkbox. Is there a way to remove this??
Lincy
  • 665
  • 1
  • 6
  • 14
45
votes
13 answers

Center text in div?

I have a div 30px high and 500px wide. This div can contain two lines of text one under the other, and is styled (padded) accordingly. But sometimes it only contains one line, and I want it to be centered. Is this possible?
Rifki
  • 867
  • 1
  • 11
  • 21
45
votes
5 answers

Add bigger margin to EditText in Android AlertDialog

I have an EditText inside an AlertDialog. It looks like this. See where it says tddjdjck and how it is indented quite a lot. That is what I want (I used setPadding with left and right set to 50), but I also want the blue line under it to be…
b85411
  • 8,054
  • 10
  • 54
  • 109