table width 궁금합니다.
바다
하다보니 이부분이 확실하게 개념이 안잡힙니다.
우선 소스는
head meta http-equiv=Content-Type content=text/html;charset=UTF-8 titleDocument/title style type=text/css rel=stylesheet div{width:800px;height:500px;} table{width:600px;margin:25px 100px;} td{padding:0 10px;} /style/headbody div table border=1 colgroup col width=100px / col width=300px / col width=200px / /colgroup thead tha/th thb/th thc/th /thead tbody tdinput type=text //td td2/td td3/td /tbody /table /div/body
제가 궁금한 점은colgroup으로 각각의 col에 넓이값을 지정해주었을 때, 각 셀의 내용의 길이가 초과 하지 않았을 경우에는 제대로 렌더링 되는것 같으나, 내용의 길이가 초과하거나, input 상자의 길이를 지정하지 않았을 때도, 셀의 넓이가 넓어지는 생겼습니다.그래서 현재 input을 쓸 때, input 자체에 class를 주어 넓이 값을 조정하여 colgroup에서 지정한 값이 제대로 렌더링 되게 하고 있는데 계속 할려니 input 넓이 값이 엄청 많아지네요.위의 예제에서 보면 첫 번째 열의 값에 100px의 넓이값을 지정했으나 input 를 넣으면 넓어지네요..각 셀의 내용이나 input 값이 colgroup에서 지정한 값안으로 자동으로 들어갈 순 없나요?
-
가을바람
아 input 값을 100%하니깐 되네요..
-
다참
input 자체에 css를 넣어주어야 겠네요..
-
솔찬
답변 감사합니다. 그렇게 하더라도 input 상자 같은 경우는 cell에서 튀어나오네용. 그럼 input 자체의 값을 따로 넣어줘야 하는거죠?
-
한울
table {table-layout:fixed;}
col에는 %단위로 잡으세요 그래야 크로스브라우징이 됩니다.