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
44
votes
7 answers

How to add padding around a WebView

My layout file defines a WebView, underneath which there are some fixed height buttons.
Dan J
  • 24,430
  • 17
  • 95
  • 168
44
votes
1 answer

Android View setPadding() vs setPaddingRelative()

Based on the Android document which doesn't give much explanation, what's the difference between setPadding() vs setPaddingRelative()?
jerrytouille
  • 1,198
  • 1
  • 11
  • 28
43
votes
5 answers

Why is the padding not working on my label elements?

I have some markup here:
dqhendricks
  • 17,461
  • 10
  • 44
  • 80
42
votes
8 answers

Is struct packing deterministic?

For example, say I have two equivalent structs a and b in different projects: typedef struct _a { int a; double b; char c; } a; typedef struct _b { int d; double e; char f; } b; Assuming I haven't used any directives like…
Govind Parmar
  • 18,500
  • 6
  • 49
  • 78
42
votes
13 answers

Center CheckBox drawable within itself

I have a CheckBox that I want centered within its own boundaries, not pushed to the side. Probably easier demonstrated than explained: Note that it isn't centered. Currently defined as:
davidcesarino
  • 15,491
  • 15
  • 66
  • 108
41
votes
7 answers

Padding a swift String for printing

I'm trying to print a list of Strings all padded to the same width. In C, I would use something like printf("%40s", cstr), where cstr is a C string. In Swift, the best I could come up is this: line += String(format:…
Droopycom
  • 1,534
  • 1
  • 15
  • 18
41
votes
6 answers

Get rid of spaces between spans

I'm trying to emulate a tab bar with HTML. I'd like the width of each tab to be set according to the text length (that is, no fixed width) and to word wrap in case it exceeds the screen width. I've almost achieved it:
opensas
  • 52,870
  • 69
  • 227
  • 340
40
votes
11 answers

Remove unwanted White Space in WebView Android

I have started developing an App using WebView. Actually I am loading an Image with Webview (I like to use the built-in zoom controls of the class). I can successfully load the Image but I can see some irritating white spaces. I can't find the way…
Manimaran
  • 401
  • 1
  • 4
  • 4
40
votes
5 answers

Padding in structures in C

This is an interview question. Till now, I used to think such questions were purely compiler dependent and shouldn't worry me, but now, I am rather curious about it. Suppose you are given two structures as: struct A { int* a; char b; } …
letsc
  • 1,933
  • 4
  • 23
  • 41
40
votes
6 answers

Android: set just one padding of textview programmatically

I want to set the top padding of a textview programmatically. I know you can do this with the method setPadding(). But the problem is that this method requires 4 parameters: left, top, right, bottom. I don't want to change the left, right and…
Xander
  • 5,007
  • 14
  • 46
  • 76
39
votes
6 answers

Using margin / padding to space from the rest of the

Ive got a block of text, and i want to write the authors name and date bellow it in small italics, so i put it in a block and styled it, but i want to space the name out a little bit so i applided margin (also tried padding) to the block but…
sam
  • 8,194
  • 30
  • 94
  • 152
38
votes
7 answers

CSS: Is it correct that text content of a div overflows into the padding?

I expected that the padding inside a div would remain clear of any text. But given the following html/css, the content-text spills out into the padding;
helloworld
.foo { float: left; overflow: hidden; background: red; …
Nigel Alderton
  • 2,086
  • 2
  • 23
  • 50
37
votes
10 answers

Flutter - how to remove default padding (48 px as per doc) from widgets (IconButton, CheckBox, FlatButton)

I am facing a problem with the default padding of the widgets (IconButton, CheckBox, FlatButton). I have searched a lot for this concern but with no success. In the above image, the outer blue rect is the actual size of these widgets and I have to…
Rahul Sharma
  • 8,050
  • 6
  • 18
  • 29
37
votes
5 answers

Pad a number with starting zero in .Net

I have a requirement to pad all single digits numbers with a starting zero. Can some one please suggest the best method? (ex 1 -> 01, 2 -> 02, etc)
Alex
  • 33,445
  • 21
  • 43
  • 41
36
votes
7 answers

Angular2 or TypeScript Left padding a String with Zeros

I have a number let say 9. But I need it as String "09". I know i can write my own logic. But I am looking for a implicit util function which can pad it. I am using angular2 with TypeScript. Looking for something like this. Just Similar like…
Partha Sarathi Ghosh
  • 8,730
  • 18
  • 53
  • 79