CSS - Summarising A Html Table To Css Code
Hey guys, Im having problems cleaning up my HTML and replacing it by CSS code.
<td width="65" height="1" style="vertical-align: top" align="left" bgcolor="#F0F0F0"> The html table code above is what I've been trying to change to CSS. Please help Similar TutorialsCan anyone help me to transform this table in css code ? <table width="1000" border="1" bordercolor="#FFCCFF"> <tr> <th width="500"> <img src="111.jpg" </th> <th width="500"> <center> <font face="Tahoma" size="60" color="#330033"> 111 </font> </center> </th> </tr> </table> I am not sure if something like the attached should be put in an html table or done with css positioning. Any thoughts? Hello all, First time poster here...hoping to find some answers! I think this is a pretty common issue so I'll be brief. I have a header that is currently coded in HTML (with tables), and I want to convert it to CSS. Of course I need to do this with my entire site, but I figure the header will be a good place to start. This is what I need to convert to CSS: eyemagic.net/zc_header4.htm Thank you for your help! -Dave I inherited a big huge site; so there is way much going on; this is a simplification... I am trying to use CSS to divide it into columns, with a column as a div. For debugging, I draw a border around the columns to show me the boundaries. But when I include the following code within the column div: Code: <div class="mycolumn"> <p>Hi, I'm in the Div!</p> <table><tr><td><p> I'm in the table</p> </td></tr></table> <p>Hi, I'm after the table; I would expect to still be in the div</p> </div> The bottom border of the div is drawn right beneath the words "Hi, I'm in the Div", and both "I'm in the table" and "I'm after the table" are outside the box boundary. This does NOT happen if I create a separate test html file and include my Column CSS, but it does happen withing the application. Now, what's going on in the application is extremely complex, involving dozens of included CSS files, javascript, smarty templates which include other smarty templates, and over 4000 files in all. Could one of the other CSS files or something else be redefining <td> somehow, or any other obvious thing that could be breaking the div? Obviously, I keep trying to debug it, but if any old hand has an explanation that might save me another 8 hours, that would be greatly appreciated. Thanks, Chris Hello, I am working with something like this: Code: <div>content one here</div> <table><tr><td>content two here</td></tr></table> How can I get the div to overlap the table and appear on top of it? Thanks! How could I make <div class="code"> replace HTML code to it's text equivalent? Like, < to <? Is there any CSS way to do it? And if not, how could I possibly go about doing it? I know I am making a mistake asking for help on a late Friday evening, but still hope... I have a website which has several "positions" and inside each position are several "modules". The positions are just where they are located on the page, and the modules are just small blocks of HTML that display something within a given position. I wish to use multiple CSS files to vary the location of the positions and also either arrange the modules horizontally or vertically. My question relates to arranging the modules within a given position. My original plan was to create a DIV with a unique ID for each position. I would then include each module within another DIV with an associated class. Something like: Code: <BODY> <DIV id="position1"> <DIV class="class1">a bunch of HTML</DIV> <DIV class="class2">a bunch of HTML</DIV> </DIV> <DIV id="position2"> <DIV class="class2">a bunch of HTML</DIV> <DIV class="class3">a bunch of HTML</DIV> </DIV> </BODY> I am now thinking I shouldn't rap my modules in a DIV tag, but instead use a LI tag. The DIV tags around the positions would remain as with my original approach. Something like: Code: <BODY> <DIV id="position1"> <UL> <LI class="class1">a bunch of HTML</LI> <LI class="class2">a bunch of HTML</LI> </UL> </DIV> <DIV id="position2"> <UL> <LI class="class2">a bunch of HTML</LI> <LI class="class3">a bunch of HTML</LI> </UL> </DIV> </BODY> Can anyone give me recommendations on which approach would be best. My server side modifications will not be too much, and I would like to do it before creating the CSS cause I am not very good at that (to me) complicated CSS stuff. Thanks!!! I'm pretty new to CSS but I'm slowly working through problems on a site I am making for some friends (more accurately a template for their content publisher) and I came across a problem. I have a table that contains all of the pictures spaced properly, but I can't get it to resize down to something that makes sense. I tried adding style="... directly to it as well as width="... but none seem to resize it. (I tried both fixed and percentages) Link: http://www.coreconsciousness.com/orangenew.html Heres the code, the external CSS doesn't contain anything important at the moment: Code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta name="generator" content="HTML Tidy for Linux (vers 1 September 2005), see www.w3.org" /><!--Don't add anything above this line, you may change the DTD to match your page--> <title>Test Page</title> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <link rel="stylesheet" href="main.css" type="text/css" /> <style type="text/css"> td.c1 { background-image: url('images/textboxorange.gif'); background-repeat: repeat-y; width:100%; } </style> </head> <body> <table id="Table_01" border="0" cellpadding="0" cellspacing="0" width="900px"> <tr> <td colspan="8"><img src="images/Orangenew_02.png" alt="" /></td> </tr> <tr> <td colspan="8"><img src="images/Orangenew_04.png" alt="" /></td> </tr> <tr> <td rowspan="2"><img src="images/Orangenew_05.png" alt="" /></td> <td rowspan="2"><img src="images/Orangenew_06.png" alt="" /></td> <td rowspan="2"><img src="images/Orangenew_07.png" alt="" /></td> <td rowspan="2"><img src="images/Orangenew_08.png" alt="" /></td> <td rowspan="2"><img src="images/Orangenew_09.png" alt="" /></td> </tr> <tr> <td><img src="images/Orangenew_11.png" alt="" /></td> <td><img src="images/Orangenew_12.png" alt="" /></td> <td rowspan="3"><img src="images/Orangenew_13.png" alt="" /></td> </tr> <tr> <td colspan="7"><img src="images/Orangenew_14.png" alt="" /></td> </tr> <tr> <td colspan="8" class="c1"> <h1>#CONTENT#</h1> <img src="images/Orangenew_15.png" alt="" /> </td> </tr> </table> </body> </html> Hi, Have a problem with a left-hand table, the content of which is dragged down the page when the right-hand table grows in the same direction, say when filling it with content. I need to anchor that left-hand table in place but allow the right-hand table to stretch vertically. Have tried absolute CSS positioning, spacers, extra tables, 100% height - nothing seems to work. I've simplified the HTML code for readability, but the general layout is pretty much intact: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <title>Untitled Document</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> </head> <body> <table width="668" border="0" cellpadding="0" cellspacing="0"> <tr> <td height="49" colspan="2" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0"> <tr> <td width="667" height="49"> </td> </tr> </table></td> <td width="1"></td> </tr> <tr> <td width="147" rowspan="3" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0"> <tr> <td width="147" height="147"> </td> </tr> </table></td> <td width="520" height="32" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0"> <tr> <td width="520" height="32"> </td> </tr> </table></td> <td></td> </tr> <tr> <td height="24" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0"> <tr> <td width="520" height="24"> </td> </tr> </table></td> <td></td> </tr> <tr> <td rowspan="2" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0"> <tr> <td width="517" height="419" valign="top"><div align="center">RIGHT-HAND TABLE </div></td> </tr> </table></td> <td height="91"></td> </tr> <tr> <td height="328" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0"> <tr> <td width="146" height="328" valign="top"><div align="center">LEFT-HAND TABLE </div></td> </tr> </table></td> <td></td> </tr> <tr> <td height="482"> </td> <td> </td> <td></td> </tr> </table> </body> </html> Thanks, Dyb Hi. First of all i am new to CSS styling . I am using asp.net and i have created an html table in wich i added some treeviews, labels and stuff. I aslo created a StyleSheet where i wanna add style to a specific label within the table. Maybe it's very simple but i don't know what else to do, i am trying to do that by ours. For instance, #Label1 { color:Orange; } it's not working, if has no effect. Label1 is the name of the label. I think i'm not refering correct the Label. Should i add a reference to the table too? i tried something but it were wrong I have a table as specified: Code: <div id="box"> // 800px set to center it with the rest of page <table id="box"> // for the rest check the css code <tr> <td id="box_top"></td> </tr> <tr> <td id="box_left"></td> <td id="box_middle"></td> <td id="box_right"></td> </tr> <tr> <td id="box_bottom"></td> </tr> </table> </div> Code: div#box { width: 800px; height: auto; } table#box { table-layout: fixed; width: 761px; height: auto; border-collapse: collapse; } #box_top { background-image: url(images/table_02.png); width: 761px; height: 27px; } #box_left { background-image: url(images/table_05.png); background-repeat: repeat-y; width: 19px; min-height: 200px; } #box_middle { background-image: url(images/table_06.png); width: 761px; min-height: 200px; background-repeat: repeat; } #box_right { background-image: url(images/table_07.png); background-repeat: repeat-y; width: 18px; min-height: 200px; } #box_bottom { background-image: url(images/table_12.png); width: 761px; height: 26px; } The table is collapsed (not at the minimum height), and the middle BG is not repeating, not even showing up. Is there anything wrong here? I've tried making a table using <div> tags but I can't really get the float / clear down yet. I've been doing CSS for a whole 2 days . Here is a view of the website. (the first table is using <table>), the 2nd I was trying <div> with floating elements. Is it not possible to do the following? What is the correct way of aligning a cell if not? PHP Code: TD.theader { background-color: #D0D0D0; border: 1px solid #000000; padding:5px; horizontal-align: right; } I haven't had much luck on converting the html table with an image in it to a css <div> that can look like a html table in a way. Old Way Code: <table border="1" cellpadding="5" cellspacing="2"> <tr> <td> <img src="test.gif"> </td> </tr> </table> New Way Code: <style type="text/css"> div.divTest { margin: 12px 0px 0px 30px; padding: 8px 8px 8px 8px; border: 3px double #000000; /* width: 0px; */ } </style> <div class="divTest"> <img src="test1.gif"> </div> Since the html table is for displaying the data and the image isn't one of them as stated by the w3.org's rule. Thanks.. I am trying to create a table with rounded cellcorners using 1 pixel gif's. It is possible to do this with html only but this creates an enormous amount of code. Unfortunately the tables have to be inserted in the WYSIWYG editor of the Vignette V7 content management system and the people inserting the tabular data are novices and do not know anything about html. Therefore I have to use css and a very simple html table. This is the code I have created so far: Code: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <title>Rounded Corner Test Using CSS</title> <meta http-equiv="content-type" content="text/html; charset=iso-8859-1"> <style type="text/css"> <!-- .header { font-weight: bold; color: #FFFFFF; background-color: #666666; background-image: url(dot_br.gif); background-position: left top; background-repeat: no-repeat; } .light { background-color: #CCCCCC; background-image: url(dot_br.gif); background-position: left top; background-repeat: no-repeat; } .dark { background-color: #999999; background-image: url(dot_br.gif); background-position: left top; background-repeat: no-repeat; } .rounded { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 9px; } --> </style> </head> <body> <table width="75%" border="0" cellspacing="1" cellpadding="3" class="rounded"> <tr class="header"> <td colspan="3">Title</td> </tr> <tr class="light"> <td>Text</td> <td>More text </td> <td>Contents</td> </tr> <tr class="dark"> <td> </td> <td> </td> <td> </td> </tr> </table> </body> </html> And this is the result: URL As you can see, using the css background property I can only place a pixel in one cellcorner at the time and I need to have them in all corners. Does anybody have an idea how to do this without making the html code too complicated? Question: If I assign an image a particular class (in this case, "photography", which I also use to align and add a border to the photo), can I have it display a bit of code as well. I'd like to be able to print a hyperlink to a script that will return EXIF data (which I have and works) to elements marked with that class? Example: Code: .photography { border: 5px solid #333333; text-align: center; } ..... <img class="photography" src="whatever.jpg" /> would display whatever.jpg in a centered 5px box with a link that says "click here for EXIF data", which, on the backend, looks like this: Code: <a href="java script:exifWindow('exif/readexif.php?path=whatever.jpg')">click here for EXIF data</a> Hi there! This might seem really basic but I don't seem to be able to remove the default border from a cell I created. The code looks like this: "<p> </p> <table align="center" style="margin-left: auto; margin-right: auto; border-width: 0px;"> <tbody> <tr> <td> <div style="overflow: auto; height: 475px; width: 700px; border-style: hidden;"> <p align="center"> <img height="457" width="600" src="images/stories/vlkommen3.jpg" alt="vlkommen3" style="margin: 0px; vertical-align: middle;" /> </p> <p align="center"> </p> <p> </p> </div> </td> </tr> </tbody> </table> <p> </p> How shall I do to hide the border? Thanks in advance! /Kristoffer I 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. |