我有一个表 - 让我们称之为表1.当单击表1中的一行时,正在显示另一个表,我们称之为表2.表2显示了与表1中单击的行相关的数据.有时需要垂直滚动要显示在表2中,有时不是 - 取决于行数.需要解决的问题:当没有显示滚动时,边框会发生不必要的转换:

.解决方案的想法:根据显示滚动是否退出的条件 " 改变margin-right".将此条件的结果保存到Redux prop:element.scrollHeight> element.clientHeight || element.scrollWidth>
element.clientWidth
问题:尝试将滚动的显示/不显示从不同的React事件(如componentDidMount,componentWillReceiveProps,CopmponentDidUpdate(设置状态导致infinte循环)和click事件更新到redux prop中.尝试使用forceUpdate()之后将道具设置为Redux也是如此.
当console.log以chrome(F12)进入控制台时,唯一与滚动条的显示/非显示正确关联的结果来自componentDidUpdate,并且它没有反映在redux prop中(isoverflown函数返回true ,redux this.props.scrollStatus和this.state.scrollStatus都是假的).也不喜欢document.getElementById用于包含行的div,因为它在props和state中打破了dom的操作,但是现在没有找到不同的解决方案.
其余代码:
1)行动:
export function setScrollStatus(scrollStatus) {
return {
type: 'SET_SCROLL_STATUS',
scrollStatus: scrollStatus
};
}Run Code Online (Sandbox Code Playgroud)
2)减速机:
export function scrollStatus(state = [], action) {
switch (action.type) {
case 'SET_SCROLL_STATUS':
return action.scrollStatus;
default:
return state;
}
}Run Code Online (Sandbox Code Playgroud)
3)Page.js(请点击图片查看代码)
import {setScrollStatus} from '../actions/relevantfilename';
function isOverflown(element) {
return element.scrollHeight > element.clientHeight ||element.scrollWidth > element.clientWidth;
} …Run Code Online (Sandbox Code Playgroud) 我有一个Excel文件(xlsm),我想将打印区域(全尺寸)导出为图像(png或任何其他图片文件格式).
我有一个VBA宏,在Excel 2013中的几台PC上运行良好,但由于我们使用Excel 2016,它只导出一个空白图像.
Sub pic_save()
Worksheets("Sheet1").Select
Set Sheet = ActiveSheet
output = C:\pic.png"
zoom_coef = 100 / Sheet.Parent.Windows(1).Zoom
Set area = Sheet.Range(Sheet.PageSetup.PrintArea)
area.CopyPicture xlPrinter
Set chartobj = Sheet.ChartObjects.Add(0, 0, area.Width * zoom_coef, area.Height * zoom_coef)
chartobj.Chart.Paste
chartobj.Chart.Export output, "png"
chartobj.Delete
End Sub
Run Code Online (Sandbox Code Playgroud) 我在gridview中有这个字段:
<asp:TemplateField ItemStyle-Width="230px" ItemStyle-HorizontalAlign="left" HeaderText="Die neusten 5 RPGs:">
<ItemTemplate>
<asp:HyperLink CssClass="linkWithoutBorder" ID="linkNewRPGUsername"
NavigateUrl='<%# Eval("RPGID","~/RPG/Nested/RPGDesc.aspx?type=In&id={0}") %>'
runat="server"><%# Eval("Name") %>
</asp:HyperLink>
</ItemTemplate>
</asp:TemplateField>
Run Code Online (Sandbox Code Playgroud)
现在我想在25个字符上切掉25个字符 - 如何?
在 Outlook 中移动文本或图像中心的正确内联 css 是什么。每当我在浏览器中打开它时,它看起来都很棒,但底部的图像和文本始终保留在 Outlook 中。不知道还有什么可以尝试的。任何帮助表示赞赏
<table cellpadding="0" cellspacing="0" border="0" width="800" align="left">
<table align="left" width="800px;">
<tr width="800px">
<td><img width="800px;" src="images/ArlingtonPic-edited.png"></td>
</tr>
</table>
<table align="left" width="800px;">
<tr width="800px">
<td width="800px" style="font-size:20px; margin-left: auto;
margin-right: auto; text-align: center; vertical-align: middle;">
<strong>Arlington Concrete Floor Boxes</strong></td>
</tr>
</table>
<table align="left" width="800px;">
<tr width="800px">
<td width="350px" style="font-size:16px; padding: -10px 10px 0 10px;">
<p>Our NEW heavy-duty<strong>FLBC4502</strong> 4.5"<strong> concrete floor
box</strong> has more! <strong> <span style="color: red">SIX conduit hubs and FOUR plugs.</span></strong>
And the NEW FLBC4502LR …Run Code Online (Sandbox Code Playgroud)