Media Log

style="table-layout:fixed"

<table style="table-layout:fixed;  border:solid 1px Gray" >
 <tr><td style="width:100px; height:40px" >동해물과 백두산이 마르고 닳도록 하느님이 보우사하사</tr></td>
</table>

table-layout:fixed 를 사용할경우
 - 테이블의 td부분의 크기를 fix시켰기때문에 td크기를 계산하지 않고 불러온다.
 - cell의 내용물이 넘쳐도 cell의 크기게 영향을 끼치지 않는다

cmd모드에서 바로 *.vbs 실행기키기
C:\WINDOWS\system32\cscript.exe 를 이용해서 실행되는 것이다.

저장은 *.vbs로 한다. cmd모드에서 해당 화일을 실행하면 바로 실행이 된다.
아래 내용은 테이블에 2004년부터 2014년까지의 날짜가 쭈욱 들어간다.
이거 잘 만 이용하면 물건이 될거 같다.

Function FormatINT(intValue, intspace)
 dim lenValue
 dim diff
 lenValue = Len(CStr(intValue))
 diff = intSpace - lenValue
 
 If diff > 0 Then
  formatInt = String(diff,"0") & intValue
 Else
  formatInt = intValue
 End If
End Function

constr = "Provider=SQLOLEDB.1;Password=;Persist Security Info=True;User ID=;Initial Catalog=test;Data Source=127.0.0.1"

Set Con = WScript.CreateObject("ADODB.Connection")
Con.Open constr

startDate = CDate("2004-01-01")
endDate = CDATE("2014-12-31")
tempDate = startDate

WScript.Echo tempDateStr

Do While True
 tempDateStr = Replace(tempDate,"-","")
 
 SQL = "INSERT INTO DIC_DATE(PDATE, PYEAR, PMONTH, PDAY, YDAYS, PQUARTER, YWEEKS, PWEEK, ISHOLIDAY, DAYDESC) " &_
 "VALUES('"& tempDateSTR & "','" &_
 FormatInt(Year(tempDate),4) & "','" &_
 FormatInt(Month(tempDate),2) & "','" &_
 FormatInt(Day(tempDate),2) & "'," &_
 Datepart("y",tempDate) & "," &_
 Datepart("q",tempDate) & "," &_
 Datepart("ww",tempDate) & "," &_
 Datepart("w",tempDate) & ",0,'') "
 
 Con.Execute(sql)
 WScript.Sleep 10

 if DateDiff("d",tempDate, endDate) <= 0 Then Exit Do
 tempDate = DateAdd("d",1,tempDate)
Loop

Con.Close
Set Con = Nothing