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.

3939 questions
112
votes
8 answers

Malloc vs new -- different padding

I'm reviewing someone else's C++ code for our project that uses MPI for high-performance computing (10^5 - 10^6 cores). The code is intended to allow for communications between (potentially) different machines on different architectures. He's…
hcarver
  • 7,126
  • 4
  • 41
  • 67
108
votes
2 answers

How to get an element's padding value using JavaScript?

I have a textarea in my HTML. I need to get the padding numerical value in pixels as either integer or float. How can I get it using JavaScript? I am not using jQuery, so I'm looking for pure JavaScript solutions.
R. Dewi
  • 4,141
  • 9
  • 41
  • 66
105
votes
5 answers

Style the first column of a table differently

If I have a table with two columns, how do I specify a padding or any other css so that it is applied just for the first column of s. Also how do I style an n-th column similarly?
Shalin
  • 1,431
  • 5
  • 12
  • 18
101
votes
10 answers

String Padding in C

I wrote this function that's supposed to do StringPadRight("Hello", 10, "0") -> "Hello00000". char *StringPadRight(char *string, int padded_len, char *pad) { int len = (int) strlen(string); if (len >= padded_len) { return string; …
jackson
94
votes
9 answers

Remove all padding and margin table HTML and CSS

I have this table :
1 2
and…
begiPass
  • 2,124
  • 6
  • 36
  • 57
94
votes
9 answers

CSS: Background image and padding

I want to add a background image on the right side of the list items, and want to have some padding from the right side as well, but I'm unable to do that. Please have a look at following example: HTML:
  • Hello
  • Hello…
user966582
  • 3,225
  • 4
  • 32
  • 33
91
votes
6 answers

IOS - remove ALL padding from UITextView

There are many great examples on SO to remove the left padding of a UITextView. How to lose margin/padding in UITextView? However, I need to remove the right padding too. I have tried... [tv setContentInset: UIEdgeInsetsMake(-4,-8,-8,-X)];//where X…
mattyd
  • 1,643
  • 2
  • 17
  • 26
86
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
  • 1,133
  • 1
  • 8
  • 13
86
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
  • 1,033
  • 1
  • 8
  • 14
82
votes
5 answers

How to set the padding for CardView widget in Android L

I'm using android:paddingLeft and android:paddingTop to set the padding for the new CardView widget but it doesn't work. I can set the margin for all the controls inside the CardView as a workaround but that's a pain if there are too many controls.…
nomongo
  • 3,435
  • 7
  • 30
  • 33
81
votes
13 answers

No padding when using overflow: auto

I can’t get padding-bottom to work when I use overflow-y: auto on a box. I use Firefox. #container { padding: 3em; overflow-x: hidden; overflow-y: auto; width: 300px; height: 300px; background: red; } #some_info { height: 900px; …
Philip
  • 6,827
  • 13
  • 75
  • 104
79
votes
3 answers

Padding-bottom/top in flexbox layout

I have a flexbox layout containing two items. One of them uses padding-bottom : #flexBox { border: 1px solid red; width: 50%; margin: 0 auto; padding: 1em; display: flex; flex-direction: column; } #text { border: 1px solid…
Simon_Weaver
  • 140,023
  • 84
  • 646
  • 689
77
votes
5 answers

Padding on StackPanel?

I am trying to set padding of a StackPanel but there ain't such property. I tried StackPanel.Border, but there is no such property either. Any ideas?
Shimmy Weitzhandler
  • 101,809
  • 122
  • 424
  • 632
75
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
  • 24,678
  • 14
  • 64
  • 87
74
votes
10 answers

UIButton Text Margin / Padding

I have the following layout, and I'm trying to add a padding to the left and right.. The controls are a disabled UIButton. My code for creating a button is this: UIButton *buttonTime = [[UIButton alloc] initWithFrame:CGRectMake(90, 10, 50, 20)];…
PartySoft
  • 2,749
  • 7
  • 39
  • 55