带Bootstrap的行和列(Rows and columns with Bootstrap)
我正在尝试创建此网页: https : //s3.amazonaws.com/codecademy-content/projects/shutterbugg/index.html
该部分的前两部分工作正常,显示图片旁边的图像。 然而,该部分的第三部分没有显示任何内容。 我的两个div的结束标记显示为白色而不是红色。
<!doctype html> <html> <head> <link rel="stylesheet" href="https://s3.amazonaws.com/codecademy-content/projects/bootstrap.min.css"> <link rel="stylesheet" href="style.css"> </head> <body> <div class="main"> <div class="container"> <h2>Heading</h2> <p>Paragraph Text</p> <a class="btn" href="#">Download Shutterbug</a> </div> </div> <div class="section"> <div class="container"> <div class="row"> <div class="col-md-6"> <img src="https://s3.amazonaws.com/codecademy-content/projects/shutterbugg/share.png"> </div> <div class="col-md-6"> <h2>Heading</h2> <p>Paragraph</p> </div> </div> <div class="row"> <div class="col-md-6"> <img src="https://s3.amazonaws.com/codecademy-content/projects/shutterbugg/explore.png"> </div> <div class="col-md-6"> <h2>Heading</h2> <p> Text Text Text Text Text </p> </div> </div> <div class="row"> <div class="col-md-6"> <img src="https://s3.amazonaws.com/codecademy-content/projects/shutterbugg/save.png"> </div> <div class="col-md-6"> <h2>Heading<h3> <p>Text Text Text</p> </div> </div> </div> </div> </div>
I am trying to create this webpage: https://s3.amazonaws.com/codecademy-content/projects/shutterbugg/index.html
The first two parts of the section work fine, displaying the image next to the picture. However the third part of the section does not display anything. The end tags of two of my div are displayed as white instead of red.
<!doctype html> <html> <head> <link rel="stylesheet" href="https://s3.amazonaws.com/codecademy-content/projects/bootstrap.min.css"> <link rel="stylesheet" href="style.css"> </head> <body> <div class="main"> <div class="container"> <h2>Heading</h2> <p>Paragraph Text</p> <a class="btn" href="#">Download Shutterbug</a> </div> </div> <div class="section"> <div class="container"> <div class="row"> <div class="col-md-6"> <img src="https://s3.amazonaws.com/codecademy-content/projects/shutterbugg/share.png"> </div> <div class="col-md-6"> <h2>Heading</h2> <p>Paragraph</p> </div> </div> <div class="row"> <div class="col-md-6"> <img src="https://s3.amazonaws.com/codecademy-content/projects/shutterbugg/explore.png"> </div> <div class="col-md-6"> <h2>Heading</h2> <p> Text Text Text Text Text </p> </div> </div> <div class="row"> <div class="col-md-6"> <img src="https://s3.amazonaws.com/codecademy-content/projects/shutterbugg/save.png"> </div> <div class="col-md-6"> <h2>Heading<h3> <p>Text Text Text</p> </div> </div> </div> </div> </div>
原文:https://stackoverflow.com/questions/31770964
最满意答案
您不需要遍历行。 Excel允许您一次性在列中的所有单元格中输入公式。
看到我快速写的这个例子。 ( 未经测试 )
Sub Sample() Dim y As Long Dim wsInfo As Worksheet, wsRank As Worksheet Dim col As String, sFormula As String On Error GoTo Whoa Application.ScreenUpdating = False Application.Calculation = xlCalculationManual Set wsInfo = ThisWorkbook.Sheets("info for run") Set wsRank = ThisWorkbook.Sheets("Ranks (Standard Form)") '~~> Loop only through columns For y = 2 To 500 '~~> Get column Name col = ReturnName(y) '~~> Store the formula in a string. Also notice the use of "$" '~~> If you do not want to keep the range constant then remove the "$" '~~> Ex: =HLOOKUP(B1,'Ranks (Standard Form)'!$A$1:$AH$283,2,FALSE) sFormula = "=HLOOKUP(B1,'" & wsRank.Name & "'!$A$1:$AH$283,ROW(),FALSE)" '~~> Insert formula in the entire column in ONE GO wsInfo.Range(col & "2:" & col & "152").Formula = sFormula Next y LetsContinue: Application.ScreenUpdating = True Application.Calculation = xlCalculationAutomatic MsgBox "Done" Exit Sub Whoa: MsgBox Err.Description Resume LetsContinue End Sub '~~> Function to get Column Name from Column Number Function ReturnName(ByVal num As Integer) As String ReturnName = Split(Cells(, num).Address, "$")(1) End Function
You don't need to loop through the rows. Excel lets you enter formula in all the cells in the column in one go.
See this example which I quickly wrote. (Untested)
Sub Sample() Dim y As Long Dim wsInfo As Worksheet, wsRank As Worksheet Dim col As String, sFormula As String On Error GoTo Whoa Application.ScreenUpdating = False Application.Calculation = xlCalculationManual Set wsInfo = ThisWorkbook.Sheets("info for run") Set wsRank = ThisWorkbook.Sheets("Ranks (Standard Form)") '~~> Loop only through columns For y = 2 To 500 '~~> Get column Name col = ReturnName(y) '~~> Store the formula in a string. Also notice the use of "$" '~~> If you do not want to keep the range constant then remove the "$" '~~> Ex: =HLOOKUP(B1,'Ranks (Standard Form)'!$A$1:$AH$283,2,FALSE) sFormula = "=HLOOKUP(B1,'" & wsRank.Name & "'!$A$1:$AH$283,ROW(),FALSE)" '~~> Insert formula in the entire column in ONE GO wsInfo.Range(col & "2:" & col & "152").Formula = sFormula Next y LetsContinue: Application.ScreenUpdating = True Application.Calculation = xlCalculationAutomatic MsgBox "Done" Exit Sub Whoa: MsgBox Err.Description Resume LetsContinue End Sub '~~> Function to get Column Name from Column Number Function ReturnName(ByVal num As Integer) As String ReturnName = Split(Cells(, num).Address, "$")(1) End Function
相关问答
更多-
要做3和4,你可以使用下面的代码: With Ark1 'insert new row in sheet one .Row("24").Insert Shift:=xlDown 'fill range A24:C24 with values .Range("A24:C24").Value = Array("Your", "Values", "Here") ' Or if specific cell values (.cells(row, column).value) ...
-
用变量语法替换范围(Replacing range with variables syntax)[2022-11-01]
你的行正在构建一个公式,但是将一个范围传递给它而不仅仅是范围的地址,请使用.Address(ReferenceStyle:=xlR1C1 。一旦那样,删除方括号: - Worksheets(" Branded").Range("A1").Formula = "=COUNTIFS(" & r.Address(ReferenceStyle:=xlR1C1) & ":" & r2.Address(ReferenceStyle:=xlR1C1) & ",RC2,R21C22:R71C22,R2C)" 它显示为#v ... -
'do nothing if filepath is found in both sheets部分'do nothing if filepath is found in both sheets ,请执行以下操作: k = ws2.Cells(1,ws2.Columns.Count).End(xlToleft).Column For j = 2 to k If ws2.Cells(i, j).Value <> CellId.Offset(, j - 1).Value Then Cell ...
-
你可以尝试这样的事情。 除了几个例外,我已经把所有东西都留下了。 lastcol = 8 Dim vars ReDim vars(1 To lastcol) 'Set vars() to the values you're looking for in the columns. LastRow = ThisWorkbook.Sheets("Boekingen AMS-IAD").Range("A" & Rows.Count).End(xlUp).Row For i = 1 To L ...
-
用R1C1摆脱所有的选择,一个不需要填写,直接分配。 Dim LRow As Long With ActiveSheet LRow = .Cells(.Rows.Count, "A").End(xlUp).Row .Range(.Cells(32, 21), .Cells(LRow, 21)).FormulaR1C1 = _ "=IF(RC[-13]=""CM"", -RC[-8],RC[-8])" .Range(.Cells(32, 22), .Cells(LR ...
-
我假设你使用的是Excel 2007+,因为这些版本中的行数和列数都大幅增加。 您可能有更好的运气检查以确保行和列计数= 1,因为这些最大值将远低于两者的乘积(即单元计数): If Target.Rows.Count = 1 And Target.Columns.Count = 1 Then I'm assuming you are on Excel 2007+ since the number of rows and columns increased dramatically in those ver ...
-
getRange所需的索引是一个基础。 尝试 var range = sheet.getRange(i, 1, 1, 3); The indices needed for getRange are one based. Try var range = sheet.getRange(i, 1, 1, 3);
-
将过滤的范围附加到工作表(Appending filtered range to sheet)[2021-10-13]
在最后一行之后粘贴,如下所示: Dim rangeTo As Range Set rangeTo = wsTo.UsedRange ' or = wsTo.Range("A1").CurrentRegion Set rangeTo = rangeTo.Offset(rangeTo.Rows.Count)(1) ' (1) is to get the first cell Application.Goto rangeTo ' optional if you want to see where the val ... -
Hlookup填充151x499表,其中包含两个变量范围(Hlookup to fill a 151x499 sheet with two variables for range)[2023-07-23]
您不需要遍历行。 Excel允许您一次性在列中的所有单元格中输入公式。 看到我快速写的这个例子。 ( 未经测试 ) Sub Sample() Dim y As Long Dim wsInfo As Worksheet, wsRank As Worksheet Dim col As String, sFormula As String On Error GoTo Whoa Application.ScreenUpdating = False Applicat ... -
您正在尝试将变量数组设置为等于范围 - 但这是不可能的,因为您无法分配给数组。 您可以将范围分配给简单的Variant (或Range变量)。 你可以改变 Dim Data() 至 Dim Data as Variant 注意没有括号。 另外,作为一个风格点,我认为明确关于类型是好的,即使Variant是默认的。 这可能足以让您的代码工作,尽管如果您想要的只是范围中的最小值,您可以更改 Set Data = Range(data_range) 至 Data = Range(data_range).Va ...