CSS - Table
Hello,
I created a table, with 600px fixed width, with 3 columns. The first column contains a checkbox so I am using a fixed with. Second column should expand. Third column has only one word so I decided to make it fixed width giving it some margin. The problem is that in IE 7 the first column, the one with the check box, gets much wider then it should be. What am I doing wrong? And is there something I should to to improve the design of my table? Here is my code: <table id="ctl02_lvTags_tTags" class="Grid"> <thead> <tr> <th class="CheckBox"> </th> <th>Tag</th> <th class="Command"> </th> </tr> </thead> <tfoot> <tr> <th colspan="2">Footer Left</th> <th>Footer Right</th> </tr> </tfoot> <tbody id="ctl02_lvTags_itemContainer"> <tr> <td class="CheckBox"> <input id="cbActive1" name="cbActive1" disabled="disabled" type="checkbox"> </td> <td> Tag 001 </td> <td class="Command"> <a id="lbEdit1">Edit</a> </td> </tr> <tr> <td class="CheckBox"> <input id="cbActive2" name="cbActive2" disabled="disabled" type="checkbox"> </td> <td> Tag 002 </td> <td class="Command"> <a id="lbEdit2">Edit</a> </td> </tr> </tbody> </table> .Grid { margin: 20px; border-collapse: collapse; color: #505050; font-size: 70%; width: 600px; } .Grid th.CheckBox { text-align: center; width: 25px; } .Grid th.Command { width: 100px; } Thanks, Miguel Similar TutorialsI have a textarea in a <td>which asks for users for some description. If users enter text and don't use any space or enter, the width of the table gets bigger and bigger and damages the pages design. What can I add (to td.fixed_width css for example )to make the line break after the width of the table is reached??? There is a solution that I put a div in td and then Code: #desc { width:"100%"; width::fixed; overflow:scroll;} but it is not exactly what I want hi every one... How can I display static headers in a table, so that headers remain visible while user scrolls the table body? This is not working in IE 7 any working example please 2. iam having a column which holds data around some 100 to 200 characters... by default i want to display some 50 characters and rest of the characters can be viewed by moving the column... if this is possible let me know how to do it with some sample code......i dont know much about CSS 3. One more problem iam facing is with the number of columns displayed in the table. I have to display around 15 to 20 columns in a table... with this 15 to 20 columns in a table, i can see scrollbar to the page ....but i dont want scrollbar to the page, instead i want want scroll bar to the table (so that it doesnot effect the design of the page) I need a fixed table width and height and also fixed column width and height..... Note: I dont mind if columns are not visible (thru scrool bar i should see the hide columns) Alright, this is probably a simple fix but I can not find the solution anywhere. I'm trying to highlight a table cell with a 2px solid red border when it is clicked. Is there a way to get this to happen with out changing the size of the cell? I hope this makes sense. Basically the cell is expanding by 1 px causing movement in the table. I'm trying to get a table inside another table which completely fills the parent table, but I cannot get it to work. The simple piece of code illustrates my problem. The red table is inside the blue table but does not cover the entire cell from top to bottom, but only the centre. I want this table to be streched. Obviously height: 100% doesn't work. Code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"> <html> <body> <table> <tbody> <tr> <td> 1<br>2<br>3<br>4<br>5<br> </td> <td style="background: blue;"> <table style="height: 100%; background: red;"> <tbody> <tr> <td style="vertical-align: bottom"> Test </td> </tr> </tbody> </table> </td> </tr> </tbody> </table> </body> </html> -------------------------------------------------------------------------------- Hello, Not exactly sure where to post this question... but: I'm having a bit of trouble keeping a table at a fixed height. What I have is a Small 200x80px table above my an input form. As users type data into the input form, javascript code dynamically updates the contents of the table. I have the table width properly fixed, and the input fields have character limitations... however if a user inputs a lot of capital letters or other wide characters, the table automatically increases in height when the text wraps. It's pretty much necessary that the text wraps for the middle lines of the table, and on the other two lines I have used the javascript to remove wrapping, but I never want the table to grow longer than 80px no matter how much is typed in the fields. Is there a way that I can constrain the table height? Thanks in advance! I have a dynamic table that is in the cell of another table. For the life of me I cant get it to stick to the top of the cell. It wants to sit at the midline of it vertically. Thanks for reading. Hi all, what i want is to customise the borders of a table... i know that <div>'s can have custom borders but, for the way that the page works i used table tags <table>. (very little experience of using <div>) is there a way that css can manipulate the borders of a table? i tried using this css: .nmhead { border-color:#cccccc; border-top:border-top-style:none; border-left:border-left-style:none; border-right:border-right-style:double; border-bottom:border-bottom-width:5px; } and then in the table doing this: <td class='nmhead'> but it didnt work (attached is what i want it to look like) any ideas? hi all ! Im having a little bit of problem to make a header and the table body match in a correct way. My header is declared as <table align="center" class="style36" id="header"> and the CSS controlling it is Code: table.style36 { width: 1000px; vertical-align:middle; } .style36 td{ font-family: Arial, Helvetica, sans-serif; font-size: 12px; vertical-align:middle; } And the table wich is declared as Code: <div class="scrollingDiv"> <table border="1" bordercolor="#000000" align="center" bgcolor="#FFFFFF" class="style13" id="tableBody" > And the CSS controlling it Code: div.scrollingDiv { height:420px; overflow:scroll; vertical-align:middle; width:1024px; } table.style13 { width: 1000px; vertical-align:middle; } /* Since the table has a class of style13, all td elements under that style can be selected as below... no need for more style definitions... */ .style13 td { vertical-align:middle; } .style13 th { vertical-align:middle; } My first idea was to declare a width for each td, something like: Code: <td width="30" bgcolor="#${color2}"><div align="center">${fila.sHoraent_Citas}</div></td> <td width="120" bgcolor="#${color2}"><div align="center"><a href="SvMedPro?boton=Info&idPaciente=${fila.idPaciente_Citas}">${fila.nom_Paciente}</a></div></td> AND match the header too, dosent seem to work, Im pretty new to web programing so any help is appreciated. Thanks! Hi, CSS whizz needed! I'm currently formatting a pre-determined HTML website using CSS. The website has been formatted with ID's for all tables and cells so I can specify which colour I'd like the background of the cells. The HTML is like this: Code: <table id="Description"> <tr><th class="title">Text</th></tr> <tr><td class="data"><div class="ggcode">Text</div></td></tr> </table> So I've been formatting it like this: Code: div#Main table#Description .title { border-color:#F0E68C; background-color:#F0E68C; } div#Main table#Description td.data { border-color:#F0E68C; background-color:#F0E68C; } However the last table is like this: Code: <table id="recentPosts"> <tr> <th class="title"> Recent Forum Posts </th> </tr> <tr> <td> <table class="data"> <tr> <th>Topic</th> <th>User</th> <th>Posted At</th> </tr> <tr> <td class="clickable forumTitle"><a href="link">Text></td> <td class="username">Text</td> <td class="date">Text12/04/2009 03:25 PM</td> </tr> <tr> <td class="clickable forumTitle"><a href="link">Text</a></td> <td class="username">Text</td> <td class="date">Text</td> </tr> </table> </td> </tr> </table> I'm able to format the cells within the <table id="recentPosts">, but I can't alter the cells within <table class="data"> - the table within the table. Any ideas how I would go about doing this? Thanks in advance I have a table with a specified background color (specified in CSS). The content part of the table (a cell) uses information from a downloaded script (wordpress.com) to load information. I want the table background to shine through everything. How can I accomplish this (I suspect it is in the script CSS, but I don't know what). URL The 'home' page is how I want it (basically that background effect). But the other pages come out funny with no background. Could someone solve this, or alternatively reccommend another way. Hello, I have a table with 3 columns and I am using the usual header, footer and body sections. The first column has only an input (check box). Is it possible to make column 1 and 3 fixed width and column 2 get the remaining width? Thank You, Miguel Hello, I understand it is better to design with <div> tags, seperating content from design. But it seems to me it compromises usability. For instance, if a visually handicapped user tries to enlarge the text on a web site with a design using layers, the text just expands out of the <div> layer, where a <table> will expand with the text. How can I overcome this issue when using the <div> tag. I am trying to make my site as user friendly as possible. Thanks... Hi, I have been trying to get this css code right, but I just don't understand it. If you go on www.lilwaynehq.com and at the bottom you will see a Latest News table. Well this is how I want the table to look like: I have tried adding the links in a <li> with a padding-bottom and a line-height, but no luck Then I placed "Subscribe to the Lil Wayne Latest News" in a <p> with a float: left and then made a span for "News Archive" called: newsa and had float: right in it, but still no luck with that And also why arent the news links on a new line when they are wrapped in <li> tags? Anyone know how I could get the table on my website to look like the one above Thanks so much and if you want the code, I will post it Hi, I am stuck , i am banging my head on the table, please would someone help me with a css problem. I have a table, 1 row by 5 columns, i have css styled its cells with their size in pixels and the table has a width in pixels. Each cell contains the contents of a php variable, this works fine but if one of the cells contents is larger than the cell it compresses all the other cells instead of wrapping the text in the cell on multiple lines. see below: http://www.sullyworld.co.uk/newforum/tst9.php?s=60&np=5 How in css can i make a cell stay the correct width and wrap the text so the hieght changes?? Help! Paul I am just starting out with CSS layouts, I wanted to know if this would be the best way to create a CSS layout with 2 columns and 3 rows or is there a better/easier way? html4strict Code: Original - html4strict Code <div style="width: 250px;"> <span style="float: left; width:50%;">1A</span> <span style="float: left; width:50%;">1B</span> </div> <div style="width: 250px; clear:both;"> <span style="float: left; width:50%;">2A</span> <span style="float: left; width:50%;">2B</span> </div> <div style="width: 250px; clear:both;"> <span style="float: left; width:50%;">3A</span> <span style="float: left; width:50%;">3B</span> </div>
I would like to do the following in css: image | background image | image I would like is so that the background image can expand dynamically according to the size of the browser window, and the two images stay on the sides. HELP fz105 Hello, I am having problems trying to convert a table into a 'div'. The problem I am running into is due to the fact that this table contains a header (see attachment), rows and cells. How would I go about adding 'rows' and 'cells' to a div? The current CSS code I am using (external file) to create the table in the attachment is the following: Code: td { background-color: #454545; border-bottom: solid 1px #000; border-right: solid 1px #000; border-left: solid 1px #000; padding: 5px; } td.header { background-image: url(../img/tableheader.gif); background-repeat: repeat-x; border-top: solid 1px #000; text-align: center; font-weight: bold; } table { margin-top: 10px; } table.mid { margin-left: auto; margin-right: auto; } What I would need is the same thing created but by making use of div's, not tables. I know it is sometimes okay to use tables for tabular data, though I want to totally get rid of them. Any help would be appreciated. Hey... I'm trying to get the background of my div style table to be semi transparent, while also trying to get the scroll transparent, am I doing something wrong? <div style="width:560px; height:200px; BORDER: #000000 1px solid; FILTER:alpha(opacity=75); overflow:auto; BACKGROUND: #666666; scrollbar-face-color : #40FF40; scrollbar-highlight-color : #000000; scrollbar-3dlight-color : #000000 ; #40FF40; scrollbar-shadow-color : #40FF40; scrollbar-darkshadow-color : #40FF40; scrollbar-track-color : #40FF40; scrollbar-arrow-color : #000000; style="FILTER:chroma(color=#40FF40); allowtransparency="true"; style="FILTER:chroma(color=#40FF40)"> I'm redesigning a site for an actor. He has an existing site, but it looks cack, hence the reason why I'm redoing it. My question is; can I use tables for this page. I'm new to using css for positioning still, and it would seem to be far easier to do this with a table. here it is |