我在这里有一段代码,它实际上可以使用 python win32com 在 excel 中格式化边框。我担心的是格式化边框所需的时间。我试图在 excel 中记录一个宏,以找出在我的脚本中转置它所需的信息,但它没有用。
所以我能做的最好的事情是在 for range 循环中运行,我总是从第 3 行开始,直到一个名为 shn[1] 的行计数器,增量为 1,从第 1 列到 10,增量为 1。从那里我使用“BorderAround()”,它工作正常但速度太慢。这是我的一段代码:
for shn in [("Beam-Beam", bb_row, bb_col), ("Beam-Col", bc_row, bc_col)]:
sheet = book.Worksheets(shn[0])
sheet.Range( "J3:DW3" ).Copy()
if shn[0] == "Beam-Col":
sheet.Range( "J3:AA3" ).Copy()
sheet.Range( sheet.Cells( 4, 10 ), sheet.Cells( shn[1]-1, 10 ) ).PasteSpecial()
for mrow in xrange(3,shn[1],1):
for mcol in xrange(1,10,1):
sheet.Cells(mrow, mcol).BorderAround()#.Border(1)
Run Code Online (Sandbox Code Playgroud)
我可以做些什么来格式化具有 ==> sheet.Range( sheet.Cells(3,1), sheet.Cells(shn[1],10) ) 之类的范围的边框?我试过“.Borders(11)”和“.Borders(12)”加上“.BorderAround()”,但只有“.BorderAround()”有效。
提前致谢。
我想要一个表格,但是当我意识到 python 中没有表格时,我决定用两个列表框来修复它。
关键是,我不希望它们之间有边界。
所以我的问题是:如何从Python中的Tk列表框中删除边框?
即使它会变白我有一个解决方案......
在 ExtJS 5 中,我想删除文本字段的边框并使其像这样:

当然可以通过两个标签来完成,但不是很干净。我在 ExtJS5 官网上尝试了以下两种方法,但是不行:
Ext.create('Ext.form.Panel', {
title: 'Contact Info',
width: 300,
bodyPadding: 10,
renderTo: Ext.getBody(),
items: [{
// here 1
xtype: 'textfield',
name: 'name',
fieldLabel: 'Name',
border: 0, // set border = 0 or false
hideBorders: true
}, {
// here 2
xtype: 'textfield',
name: 'email',
fieldLabel: 'Email Address',
style: 'border: none;background-image:none;' // set style border none
}]
Run Code Online (Sandbox Code Playgroud)
});
结果:

有人有任何想法吗?谢谢。
嘿,我想知道如何在无序列表周围和列表周围制作边框。有点像盒子。我试图在网上搜索它,但我根本无法弄清楚。
我正在开发一个使用 react.js 和 sass 作为样式的 web 应用程序(所以我所有的样式文件都是 .scss)。我有一个当前样式的文本框:
input[type=text] {
text-align: center;
font: inherit;
border: 6px solid #999999;
padding: 5px 5px;
font-size: 15px;
box-shadow: 0 1px 1px #DDD;
width: 223px;
outline: none;
display: block;
color: #7B8585;
margin: 0 auto 20px;
}
Run Code Online (Sandbox Code Playgroud)
在某些时候,我的应用程序想要更改边框颜色。这就是我所拥有的:
var borderStyle;
if (gradient) {
borderStyle = {
'borderImage': '-webkit-linear-gradient(left, #0083c5 0%, #0083c5 33%, #ec4a26 66%, #ec4a26 100%)',
};
}
Run Code Online (Sandbox Code Playgroud)
后来,输入组件:
<input type="text" style={borderStyle} onChange={this.handleChange} />
Run Code Online (Sandbox Code Playgroud)
目前我看到的是一个白色边框,边框的每个角都有一个红蓝渐变的小图像。我试过使用borderColor,显然它根本不适用于渐变。我是否遗漏了一些明显的东西,或者不可能做一个简单的边框渐变?
所需的结果是从左到右的渐变(因此左边框完全为蓝色,右侧完全为红色,顶部和底部边框具有蓝色到红色的过渡)。
针对Harry的回答,我改成如下代码:
input[type=text] {
text-align: center;
font: inherit;
border: …Run Code Online (Sandbox Code Playgroud)我有几个<li>内联列出,每个都有以下属性:
border-bottom-color: #eee;
Run Code Online (Sandbox Code Playgroud)
我试图第一个和最后一个目标<li>并填充它们border-bottom,#eee但只填充一半。结果,第一个的底部边框<li>将从右侧开始填充 50%,最后一个的底部边框<li>将从左侧开始填充 50%。
我怎样才能做到这一点?除了可能只是height: 1px在我的ul.
我试图将 JTable 显示为网格,单元格之间有线条。不过,我只能在单个单元格中添加边框,这看起来永远不正确;如果我添加完整的边框,我会得到一堆断开的框,看起来很丑陋和错误。使用 MatteBorders(如下面的代码)看起来会好一些,但会导致边界线不完全相交的间隙。
public Component prepareRenderer(TableCellRenderer renderer, int row, int column) {
Component stamp = super.prepareRenderer(renderer, row, column);
int top = 1;
int left = 1;
int bottom = row == 7 ? 1 : 0; //Grid is always 8x8, this ensures the bottom/right will have full borders.
int right = column == 7 ? 1 : 0;
MatteBorder border = new MatteBorder(top, left, bottom, right, Color.BLACK);
if (stamp instanceof JComponent) {
((JComponent) stamp).setBorder(border);
}
return stamp;
}
Run Code Online (Sandbox Code Playgroud)
我觉得必须有某种方法可以正确地做到这一点,这样我才能在单元格元素之间获得网格线。我错过了什么?如果不出意外,有没有办法让 …
只需将鼠标悬停在下面片段中的“标题”上,您就会看到元素是如何移动的。为什么?
没有边距 .. 只有当我向inline-block元素添加边框时它们才会移动。尝试添加更多边框宽度, section.twelve a例如:
section.twelve a {
border-bottom: 10px solid #FFFAFF;
}
Run Code Online (Sandbox Code Playgroud)
但是如果你移除边框一切都很好..为什么会出现这种行为?它仅用于边界吗?
我只想向元素添加任何样式而不影响其他样式。
section.twelve a {
border-bottom: 10px solid #FFFAFF;
}
Run Code Online (Sandbox Code Playgroud)
section{
position: relative;
height: 300px;
padding: 15px 80px;
z-index: 1;
}
section h1{
font-size:3em;
font-weight: 100;
line-height: 1.3;
}
section a {
position: relative;
display: inline-block;
text-decoration: none;
transition: all 0.3s ease-in-out;
vertical-align: bottom;
}
section.twelve {
background: #121A5A;
color: #FFFAFF;
}
section.twelve a {
color:#D8315B;
font-weight: 700;
overflow: …Run Code Online (Sandbox Code Playgroud)我想在 UIView 上设置带有边框的左下角和右下角半径。这是代码。**问题是它没有在 1.5 边框中显示 SHARP **
class BorderView: UIView {
override func draw(_ rect: CGRect) {
let color = UIColor.red
let color2 = UIColor.brown
//// Rectangle Drawing
let rectanglePath = UIBezierPath(roundedRect: CGRect(x: 0, y: 0, width: 200, height: 200), byRoundingCorners: [.bottomRight, .bottomLeft], cornerRadii: CGSize(width: 10, height: 10))
rectanglePath.close()
color2.setFill()
rectanglePath.fill()
color.set()
rectanglePath.lineWidth = 1.5
rectanglePath.stroke()
}
}
Run Code Online (Sandbox Code Playgroud)
输出
预期产出