margin

Can I make Swing JButtons have smaller margins?

笑着哭i 提交于 2020-01-01 07:33:36
问题 I prefer buttons with minimal margins, about as wide as their text caption. Is there a way to achieve that in a JButton in Swing? What I am seeing in practice now is that even if I try to use setMaximumSize() and similar, it just ends up eating the text caption, cutting it off to the right. But it does not reduce the margins. 回答1: I believe setMargin is what you're looking for. myButton.setMargin(new Insets(0, 0, 0, 0)); 回答2: Worth noting you can make the values for Insets -ve. This makes

TCPDF set bottom margin zero

被刻印的时光 ゝ 提交于 2020-01-01 04:01:12
问题 I am creating pdf using TCPDF in php,I need to include my data into pdf without bottom margines,The data will be included at the end of the page. $pdf->SetLeftMargin(14); $pdf->SetTopMargin(6); $pdf->SetFont($fontname, '', '9'); $pdf->setPrintHeader(false); $pdf->SetFooterMargin(0); $pdf->setPrintFooter(false); $pdf->AddPage(); $pdf->writeHTML($html, true, 0, true, 0); I am using the above code.Anyone know how to remove margin space from pdf using tcpdf? 回答1: Margin that you are seeing is due

C#WPF扫雷

落花浮王杯 提交于 2019-12-31 20:46:13
还有点小问题,基本功能都可以实现,排行榜排名没有实现 设计界面 <Window x:Class="扫雷.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:local="clr-namespace:扫雷" mc:Ignorable="d" Title="扫雷" Height="700" Width="700" Icon="img/logo.ico" WindowStartupLocation="CenterScreen" Loaded="Window_Loaded"> <Grid x:Name="g"> <Grid.RowDefinitions> <RowDefinition Height="30"></RowDefinition> <RowDefinition Height="70"><

jQuery 初识 筛选器 属性选择器

谁都会走 提交于 2019-12-31 14:43:57
---------------------------大事使我们惊讶,小事使我们沮丧,久而久之,我们对这二者都会习以为常。 一 jQuery是什么? [1] jQuery由美国人John Resig创建,至今已吸引了来自世界各地的众多 javascript高手加入其team。 [2] jQuery是继prototype之后又一个优秀的Javascript框架。其宗旨是——WRITE LESS,DO MORE! [3] 它是轻量级的js库(压缩后只有21k) ,这是其它的js库所不及的,它兼容CSS3,还兼容各种浏览器 [4] jQuery是一个快速的,简洁的javaScript库,使用户能更方便地处理HTMLdocuments、events、实现动画效果,并且方便地为网站提供AJAX交互。 [5] jQuery还有一个比较大的优势是,它的文档说明很全,而且各种应用也说得很详细,同时还有许多成熟的插件可供选择。 回到顶部 二 什么是 jQuery 对象? jQuery 对象就是通过 jQuery 包装 DOM 对象后产生的对象。 jQuery 对象是 jQuery 独有的 . 如果一个对象是 jQuery 对象 , 那么它就可以使用 jQuery 里的方法 : $(“#test”).html(); $("#test").html() 意思是指:获取ID为test的元素内的html代码

CSS:谈谈栅格布局

亡梦爱人 提交于 2019-12-31 14:41:55
  检验前端的一个基本功就是考查他的布局。很久之前圣杯布局风靡一时,这里就由圣杯布局开始,到最流行的bootstrap栅格布局。    圣杯布局   圣杯布局是一种三列布局,两边定宽,中间自适应: 1 * { 2 box-sizing: border-box; 3 } 4 html, body{ 5 width: 100%; 6 height: 100%; 7 margin: 0; 8 } 9 .container{ 10 width:100%; 11 } 12 .container:after{ 13 display: table; 14 content:"."; 15 clear:both; 16 } 17 18 .container .cl{ 19 float:left; 20 border: 1px solid red; 21 height: 200px; 22 } 23 24 .main{ 25 width:100%; 26 padding 0 290px 0 320px; 27 background-color: blue; 28 } 29 .sub{ 30 width: 320px; 31 margin-left:-100%; 32 background-color: white; 33 } 34 .extra{ 35 width: 290px; 36 margin

jQuery框架-1.jQuery基础知识

不问归期 提交于 2019-12-31 14:06:39
jQuery简介 jQuery,顾名思义是JavaScript和查询(Query),jQuery是免费、开源的。它可以简化查询DOM对象、处理事件、制作动画、处理Ajax交互过程且兼容多浏览器的javascript库,核心理念是write less,do more(写得更少,做得更多)。 jQuery 优势 体积小,使用灵巧(只需引入一个js文件)。 方便的选择页面元素(模仿CSS选择器更精确、灵活)。 动态更改页面样式/页面内容(操作DOM,动态添加、移除样式)。 控制响应事件(动态添加响应事件)。 提供基本网页特效(提供已封装的网页特效方法)。 快速实现通信(ajax)。 易扩展、插件丰富。 支持链式写法。 引入jQuery 通过script引入本地jQuery文件。 通过引入CDN上面jQuery文件。 版本选择 1.x:兼容ie678,使用最为广泛的,官方只做BUG维护,功能不再新增。因此一般项目来说,使用1.x版本就可以了,最终版本:1.12.4 (2016年5月20日) 2.x:不兼容ie678,很少有人使用,官方只做BUG维护,功能不再新增。如果不考虑兼容低版本的浏览器可以使用2.x,最终版本:2.2.4 (2016年5月20日) 3.x:不兼容ie678,只支持最新的浏览器。除非特殊要求,一般不会使用3.x版本的,很多老的jQuery插件不支持这个版本

Add margin to PDF file when merging using PDFTK or similar

南笙酒味 提交于 2019-12-31 13:46:05
问题 I have a large collection of half-page sized PDF cut-sheets that are held in a folder on my Linux server. A user to the site will want to create a booklet from a subset of these. The booklet will be bound therefore the even pages of the collection will want more margin on the right side and the odd pages will want more margin on the left side. There can be up to 200 pages in a collection out of a universe of 500 pages so I don't want to regenerate each page to set the margin of it. It would

Jquery中的offset()和position()深入剖析

对着背影说爱祢 提交于 2019-12-31 06:56:05
jquery 中有两个获取元素位置的方法offset()和position(),这两个方法之间有什么异同?使用的时候应该注意哪些问题?什么时候使用offset(),什么时候又使用position()呢? 先看看这两个方法的定义。 offset(): 获取匹配元素在当前视口的相对偏移。 返回的对象包含两个整形属性:top 和 left。此方法只对可见元素有效。 position(): 获取匹配元素相对父元素的偏移。 返回的对象包含两个整形属性:top 和 left。为精确计算结果,请在补白、边框和填充属性上使用像素单位。此方法只对可见元素有效。 真的就这么简单吗?实践出真知。 先来看看在jquery框架源码里面,是怎么获得position()的: 代码如下: // Get *real* offsetParent var offsetParent = this.offsetParent(), // Get correct offsets offset = this.offset(), parentOffset = /^body|html$/i.test(offsetParent[0].tagName) ? { top: 0, left: 0 } : offsetParent.offset(); // Subtract element margins // note: when an

Jquery中的offset()和position()深入剖析(元素定位)

本秂侑毒 提交于 2019-12-31 06:54:16
先看看这两个方法的定义。 offset(): 获取匹配元素在当前视口的相对偏移。 返回的对象包含两个整形属性:top 和 left。此方法只对可见元素有效。 position(): 获取匹配元素相对父元素的偏移。 返回的对象包含两个整形属性:top 和 left。为精确计算结果,请在补白、边框和填充属性上使用像素单位。此方法只对可见元素有效。 真的就这么简单吗?实践出真知。 先来看看在jquery框架源码里面,是怎么获得position()的: 1 // Get *real* offsetParent 2 var offsetParent = this.offsetParent(), 3 // Get correct offsets 4 offset = this.offset(), 5 parentOffset = /^body|html$/i.test(offsetParent[0].tagName) ? { top: 0, left: 0 } : offsetParent.offset(); 6 // Subtract element margins 7 // note: when an element has margin: auto the offsetLeft and marginLeft 8 // are the same in Safari causing

How to add animation to margin property of TextBlock in WPF

£可爱£侵袭症+ 提交于 2019-12-31 05:41:06
问题 I want to make TextBlock like this But, aTextBlock.BeginAnimation(Button.MarginProperty, myDoubleAnimation); get this error 'System.Windows.Media.Animation.DoubleAnimation' cannot be used to animate the 'Margin' property of type 'System.Windows.Thickness'. I have test in Xaml and get same error: <Border CornerRadius="8" Background="Red" Margin="352,173,214,368"> <TextBlock x:Name="TestB" Text="{Binding ElementName=MTxt,Path=Text,NotifyOnSourceUpdated=True}" Margin="0,0,0,0"